@@ -366,9 +366,11 @@ same trait object.
366
366
* zero-extend if the source is unsigned
367
367
* sign-extend if the source is signed
368
368
* Casting from a float to an integer will round the float towards zero
369
- * ** [ NOTE: currently this will cause Undefined Behavior if the rounded
370
- value cannot be represented by the target integer type] [ float-int ] ** .
371
- This includes Inf and NaN. This is a bug and will be fixed.
369
+ * ` NaN ` will return ` 0 `
370
+ * Values larger than the maximum integer value will saturate to the
371
+ maximum value of the integer type.
372
+ * Values smaller than the minimum integer value will saturate to the
373
+ minimum value of the integer type.
372
374
* Casting from an integer to float will produce the closest possible float \*
373
375
* if necessary, rounding is according to ` roundTiesToEven ` mode \*\*\*
374
376
* on overflow, infinity (of the same sign as the input) is produced
@@ -398,8 +400,6 @@ expected.
398
400
number, preferring the one with an even least significant digit if exactly
399
401
halfway between two floating point numbers.
400
402
401
- [ float-int ] : https://github.com/rust-lang/rust/issues/10184
402
-
403
403
## Assignment expressions
404
404
405
405
> ** <sup >Syntax</sup >** \
@@ -456,7 +456,6 @@ assert_eq!(x, 14);
456
456
[ place expression ] : ../expressions.md#place-expressions-and-value-expressions
457
457
[ value expression ] : ../expressions.md#place-expressions-and-value-expressions
458
458
[ temporary value ] : ../expressions.md#temporaries
459
- [ float-int ] : https://github.com/rust-lang/rust/issues/10184
460
459
[ float-float ] : https://github.com/rust-lang/rust/issues/15536
461
460
[ `unit` type ] : ../types/tuple.md
462
461
0 commit comments