Skip to content

Commit 1514bc1

Browse files
authored
Rollup merge of rust-lang#63366 - lzutao:fix-float-to-le-bytes-typo, r=Centril
doc: Fix typo in float from bytes methods Thanks @That3Percent for pointing it out. r? @Centril
2 parents eeacbee + 9163990 commit 1514bc1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libcore/num/f32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl f32 {
536536
Self::from_bits(u32::from_be_bytes(bytes))
537537
}
538538

539-
/// Create a floating point value from its representation as a byte array in big endian.
539+
/// Create a floating point value from its representation as a byte array in little endian.
540540
///
541541
/// # Examples
542542
///
@@ -551,7 +551,7 @@ impl f32 {
551551
Self::from_bits(u32::from_le_bytes(bytes))
552552
}
553553

554-
/// Create a floating point value from its representation as a byte array in big endian.
554+
/// Create a floating point value from its representation as a byte array in native endian.
555555
///
556556
/// As the target platform's native endianness is used, portable code
557557
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as

src/libcore/num/f64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl f64 {
549549
Self::from_bits(u64::from_be_bytes(bytes))
550550
}
551551

552-
/// Create a floating point value from its representation as a byte array in big endian.
552+
/// Create a floating point value from its representation as a byte array in little endian.
553553
///
554554
/// # Examples
555555
///
@@ -564,7 +564,7 @@ impl f64 {
564564
Self::from_bits(u64::from_le_bytes(bytes))
565565
}
566566

567-
/// Create a floating point value from its representation as a byte array in big endian.
567+
/// Create a floating point value from its representation as a byte array in native endian.
568568
///
569569
/// As the target platform's native endianness is used, portable code
570570
/// likely wants to use [`from_be_bytes`] or [`from_le_bytes`], as

0 commit comments

Comments
 (0)