Skip to content

Commit 8eb3455

Browse files
committed
Add note to as_f32 documentation
1 parent 3641f59 commit 8eb3455

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,9 @@ impl NotNan<f64> {
11891189
/// Converts this [`NotNan`]`<`[`f64`]`>` to a [`NotNan`]`<`[`f32`]`>` while giving up on
11901190
/// precision, [using `roundTiesToEven` as rounding mode, yielding `Infinity` on
11911191
/// overflow](https://doc.rust-lang.org/reference/expressions/operator-expr.html#semantics).
1192+
///
1193+
/// Note: For the reverse conversion (from `NotNan<f32>` to `NotNan<f64>`), you can use
1194+
/// `.into()`.
11921195
pub fn as_f32(self) -> NotNan<f32> {
11931196
// This is not destroying invariants, as it is a pure rounding operation. The only two special
11941197
// cases are where f32 would be overflowing, then the operation yields Infinity, or where

0 commit comments

Comments
 (0)