Skip to content

Commit

Permalink
float_bits_conv made it into 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 authored and alexcrichton committed Aug 12, 2017
1 parent a2b8556 commit 808f8ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/libstd/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ impl f32 {
/// assert_eq!((12.5f32).to_bits(), 0x41480000);
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn to_bits(self) -> u32 {
unsafe { ::mem::transmute(self) }
Expand Down Expand Up @@ -1125,7 +1125,7 @@ impl f32 {
/// let snan = 0x7F800001;
/// assert_ne!(f32::from_bits(snan).to_bits(), snan);
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn from_bits(mut v: u32) -> Self {
const EXP_MASK: u32 = 0x7F800000;
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ impl f64 {
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn to_bits(self) -> u64 {
unsafe { ::mem::transmute(self) }
Expand Down Expand Up @@ -1040,7 +1040,7 @@ impl f64 {
/// let snan = 0x7FF0000000000001;
/// assert_ne!(f64::from_bits(snan).to_bits(), snan);
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn from_bits(mut v: u64) -> Self {
const EXP_MASK: u64 = 0x7FF0000000000000;
Expand Down

0 comments on commit 808f8ea

Please sign in to comment.