Skip to content

Commit fff5a06

Browse files
committed
Add references to explanation about portability to f{32,64}::{from,to}_{be,le,ne}_bytes
1 parent a965778 commit fff5a06

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

library/core/src/num/f32.rs

+18
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,9 @@ impl f32 {
902902
/// Return the memory representation of this floating point number as a byte array in
903903
/// big-endian (network) byte order.
904904
///
905+
/// See [`from_bits`](Self::from_bits) for some discussion of the
906+
/// portability of this operation (there are almost no issues).
907+
///
905908
/// # Examples
906909
///
907910
/// ```
@@ -920,6 +923,9 @@ impl f32 {
920923
/// Return the memory representation of this floating point number as a byte array in
921924
/// little-endian byte order.
922925
///
926+
/// See [`from_bits`](Self::from_bits) for some discussion of the
927+
/// portability of this operation (there are almost no issues).
928+
///
923929
/// # Examples
924930
///
925931
/// ```
@@ -944,6 +950,9 @@ impl f32 {
944950
/// [`to_be_bytes`]: f32::to_be_bytes
945951
/// [`to_le_bytes`]: f32::to_le_bytes
946952
///
953+
/// See [`from_bits`](Self::from_bits) for some discussion of the
954+
/// portability of this operation (there are almost no issues).
955+
///
947956
/// # Examples
948957
///
949958
/// ```
@@ -968,6 +977,9 @@ impl f32 {
968977

969978
/// Create a floating point value from its representation as a byte array in big endian.
970979
///
980+
/// See [`from_bits`](Self::from_bits) for some discussion of the
981+
/// portability of this operation (there are almost no issues).
982+
///
971983
/// # Examples
972984
///
973985
/// ```
@@ -984,6 +996,9 @@ impl f32 {
984996

985997
/// Create a floating point value from its representation as a byte array in little endian.
986998
///
999+
/// See [`from_bits`](Self::from_bits) for some discussion of the
1000+
/// portability of this operation (there are almost no issues).
1001+
///
9871002
/// # Examples
9881003
///
9891004
/// ```
@@ -1007,6 +1022,9 @@ impl f32 {
10071022
/// [`from_be_bytes`]: f32::from_be_bytes
10081023
/// [`from_le_bytes`]: f32::from_le_bytes
10091024
///
1025+
/// See [`from_bits`](Self::from_bits) for some discussion of the
1026+
/// portability of this operation (there are almost no issues).
1027+
///
10101028
/// # Examples
10111029
///
10121030
/// ```

library/core/src/num/f64.rs

+18
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,9 @@ impl f64 {
918918
/// Return the memory representation of this floating point number as a byte array in
919919
/// big-endian (network) byte order.
920920
///
921+
/// See [`from_bits`](Self::from_bits) for some discussion of the
922+
/// portability of this operation (there are almost no issues).
923+
///
921924
/// # Examples
922925
///
923926
/// ```
@@ -936,6 +939,9 @@ impl f64 {
936939
/// Return the memory representation of this floating point number as a byte array in
937940
/// little-endian byte order.
938941
///
942+
/// See [`from_bits`](Self::from_bits) for some discussion of the
943+
/// portability of this operation (there are almost no issues).
944+
///
939945
/// # Examples
940946
///
941947
/// ```
@@ -960,6 +966,9 @@ impl f64 {
960966
/// [`to_be_bytes`]: f64::to_be_bytes
961967
/// [`to_le_bytes`]: f64::to_le_bytes
962968
///
969+
/// See [`from_bits`](Self::from_bits) for some discussion of the
970+
/// portability of this operation (there are almost no issues).
971+
///
963972
/// # Examples
964973
///
965974
/// ```
@@ -984,6 +993,9 @@ impl f64 {
984993

985994
/// Create a floating point value from its representation as a byte array in big endian.
986995
///
996+
/// See [`from_bits`](Self::from_bits) for some discussion of the
997+
/// portability of this operation (there are almost no issues).
998+
///
987999
/// # Examples
9881000
///
9891001
/// ```
@@ -1000,6 +1012,9 @@ impl f64 {
10001012

10011013
/// Create a floating point value from its representation as a byte array in little endian.
10021014
///
1015+
/// See [`from_bits`](Self::from_bits) for some discussion of the
1016+
/// portability of this operation (there are almost no issues).
1017+
///
10031018
/// # Examples
10041019
///
10051020
/// ```
@@ -1023,6 +1038,9 @@ impl f64 {
10231038
/// [`from_be_bytes`]: f64::from_be_bytes
10241039
/// [`from_le_bytes`]: f64::from_le_bytes
10251040
///
1041+
/// See [`from_bits`](Self::from_bits) for some discussion of the
1042+
/// portability of this operation (there are almost no issues).
1043+
///
10261044
/// # Examples
10271045
///
10281046
/// ```

0 commit comments

Comments
 (0)