diff options
| author | FenrirWolf <[email protected]> | 2018-02-17 13:04:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-02-17 13:04:42 -0700 |
| commit | 81c3c0b63dc5fd9d7504e6add8f3a3f7b7beb0d1 (patch) | |
| tree | ff21a014ed0623381f5c58aab3eab914d4f50c01 /ctr-std/src/f64.rs | |
| parent | Fix TcpStream::wait_timeout (diff) | |
| parent | Update pinned nightly (diff) | |
| download | ctru-rs-81c3c0b63dc5fd9d7504e6add8f3a3f7b7beb0d1.tar.xz ctru-rs-81c3c0b63dc5fd9d7504e6add8f3a3f7b7beb0d1.zip | |
Merge pull request #62 from FenrirWolf/update-1.24
Pull in upstream changes for rust 1.24.0
Diffstat (limited to 'ctr-std/src/f64.rs')
| -rw-r--r-- | ctr-std/src/f64.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ctr-std/src/f64.rs b/ctr-std/src/f64.rs index e4eea74..6f34f17 100644 --- a/ctr-std/src/f64.rs +++ b/ctr-std/src/f64.rs @@ -970,7 +970,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn to_bits(self) -> u64 { - unsafe { ::mem::transmute(self) } + num::Float::to_bits(self) } /// Raw transmutation from `u64`. @@ -978,7 +978,7 @@ impl f64 { /// This is currently identical to `transmute::<u64, f64>(v)` on all platforms. /// It turns out this is incredibly portable, for two reasons: /// - /// * Floats and Ints have the same endianess on all supported platforms. + /// * Floats and Ints have the same endianness on all supported platforms. /// * IEEE-754 very precisely specifies the bit layout of floats. /// /// However there is one caveat: prior to the 2008 version of IEEE-754, how @@ -1014,8 +1014,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn from_bits(v: u64) -> Self { - // It turns out the safety issues with sNaN were overblown! Hooray! - unsafe { ::mem::transmute(v) } + num::Float::from_bits(v) } } |