rust/src/libcore/num
Simon Sapin cba479f75c Add {f32,f64}::approx_unchecked_to<Int> unsafe methods
As discussed in https://github.com/rust-lang/rust/issues/10184

Currently, casting a floating point number to an integer with `as` is Undefined Behavior if the value is out of range. `-Z saturating-float-casts` fixes this soundness hole by making `as` “saturate” to the maximum or minimum value of the integer type (or zero for `NaN`), but has measurable negative performance impact in some benchmarks. There is some consensus in that thread for enabling saturation by default anyway, but provide an `unsafe fn` alternative for users who know through some other mean that their values are in range.
2019-12-06 14:01:05 +01:00
..
dec2flt Make dec2flt_table compatible with rustfmt 2019-11-29 20:17:09 -08:00
flt2dec Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
bignum.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
diy_float.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00
f32.rs Add {f32,f64}::approx_unchecked_to<Int> unsafe methods 2019-12-06 14:01:05 +01:00
f64.rs Add {f32,f64}::approx_unchecked_to<Int> unsafe methods 2019-12-06 14:01:05 +01:00
i8.rs Remove licenses 2018-12-25 21:08:33 -07:00
i16.rs Remove licenses 2018-12-25 21:08:33 -07:00
i32.rs Remove licenses 2018-12-25 21:08:33 -07:00
i64.rs Remove licenses 2018-12-25 21:08:33 -07:00
i128.rs Remove licenses 2018-12-25 21:08:33 -07:00
int_macros.rs Remove licenses 2018-12-25 21:08:33 -07:00
isize.rs Remove licenses 2018-12-25 21:08:33 -07:00
mod.rs Redefine core::convert::Infallible as !. 2019-11-21 14:55:33 +01:00
u8.rs Remove licenses 2018-12-25 21:08:33 -07:00
u16.rs Remove licenses 2018-12-25 21:08:33 -07:00
u32.rs Remove licenses 2018-12-25 21:08:33 -07:00
u64.rs Remove licenses 2018-12-25 21:08:33 -07:00
u128.rs Remove licenses 2018-12-25 21:08:33 -07:00
uint_macros.rs Remove licenses 2018-12-25 21:08:33 -07:00
usize.rs Remove licenses 2018-12-25 21:08:33 -07:00
wrapping.rs Format libcore with rustfmt 2019-11-26 23:02:11 -08:00