Skip to content

Commit e67ba44

Browse files
committed
Indirectly update to libm 0.2
Unfortunately, `libm 0.2` removed the `F32Ext` and `F64Ext` extension traits, which makes it harder to choose the different methods. However, this was already dealt with in rust-num/num-traits#144 for `Float`, so we can piggy-back on that here, no longer using `libm` directly.
1 parent fb293a5 commit e67ba44

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

alga/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ default = [ "std" ]
1919
std = [ ]
2020

2121
[dependencies]
22-
num-traits = { version = "0.2", default-features = false }
22+
num-traits = { version = "0.2.11", default-features = false, features = ["libm"] }
2323
approx = { version = "0.3", default-features = false }
2424
decimal = { version = "2.0", default-features = false, optional = true }
2525
num-complex = { version = "0.2", default-features = false }
26-
libm = "0.1"
2726

2827
[dev-dependencies]
2928
quickcheck = "0.8"

alga/src/general/complex.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ use std::{f32, f64};
77
use crate::general::{Field, JoinSemilattice, MeetSemilattice, RealField, SubsetOf, SupersetOf};
88

99
#[cfg(not(feature = "std"))]
10-
use libm::F32Ext;
11-
#[cfg(not(feature = "std"))]
12-
use libm::F64Ext;
13-
#[cfg(not(feature = "std"))]
14-
use num;
10+
use num::Float;
1511
//#[cfg(feature = "decimal")]
1612
//use decimal::d128;
1713

@@ -474,8 +470,8 @@ macro_rules! impl_complex(
474470

475471
#[cfg(not(feature = "std"))]
476472
impl_complex!(
477-
f32, f32, F32Ext;
478-
f64, f64, F64Ext
473+
f32, f32, Float;
474+
f64, f64, Float
479475
);
480476

481477
#[cfg(feature = "std")]

alga/src/general/real.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ use approx::{RelativeEq, UlpsEq};
66
use crate::general::{ComplexField, Lattice};
77

88
#[cfg(not(feature = "std"))]
9-
use libm::F32Ext;
10-
#[cfg(not(feature = "std"))]
11-
use libm::F64Ext;
12-
#[cfg(not(feature = "std"))]
13-
use num;
9+
use num::Float;
1410
//#[cfg(feature = "decimal")]
1511
//use decimal::d128;
1612

@@ -180,7 +176,7 @@ macro_rules! impl_real(
180176
);
181177

182178
#[cfg(not(feature = "std"))]
183-
impl_real!(f32,f32,F32Ext; f64,f64,F64Ext);
179+
impl_real!(f32,f32,Float; f64,f64,Float);
184180
#[cfg(feature = "std")]
185181
impl_real!(f32,f32,f32; f64,f64,f64);
186182
//#[cfg(feature = "decimal")]

0 commit comments

Comments
 (0)