diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-09 17:24:14 +1100 |
|---|---|---|
| committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-11-13 02:02:44 +1100 |
| commit | 9fe94bd995ab13afab7078a708b01f365740d2cd (patch) | |
| tree | e92121add768458f0055949991505c17c272f400 /src/libstd/num/f32.rs | |
| parent | e6db701d5b09c169297aaaf2d5d53f64bcb4676e (diff) | |
| download | rust-9fe94bd995ab13afab7078a708b01f365740d2cd.tar.gz rust-9fe94bd995ab13afab7078a708b01f365740d2cd.zip | |
Move abs_sub to FloatMath
This removes the need for libcore to depend on libm. `abs_sub` is not as useful for integers.
Diffstat (limited to 'src/libstd/num/f32.rs')
| -rw-r--r-- | src/libstd/num/f32.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 175b1612b7e..6e2e8b8752f 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -109,6 +109,11 @@ impl FloatMath for f32 { } #[inline] + fn abs_sub(self, other: f32) -> f32 { + unsafe { cmath::fdimf(self, other) } + } + + #[inline] fn cbrt(self) -> f32 { unsafe { cmath::cbrtf(self) } } |
