core::num::bigfloat
本頁內容
API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。
float. #[keyword("float")]
routes the type name here; an unsuffixed literal in a float slot is
Float::from_f64, or Float::from_literal when f64 can't hold it.
A float has f64's 53-bit significand and an i64 exponent. In
f64's normal range it is an f64 (e == 0) with IEEE 754
operations. A finite result outside that range is promoted to
m * 2^e, 1 <= |m| < 2, rounded to nearest-even instead of
becoming +/-inf / 0 / subnormal, so arithmetic never
overflows; only / 0 and inf / NaN operands give inf / NaN.
Structs
FloatSource
pub struct Floatm * 2^e. e == 0: m is the value (zero, normal, inf or NaN,
never subnormal). e != 0: 1 <= |m| < 2 and e is outside
f64's normal exponents -1022..=1023.
The value
x, exactly (subnormals, NaN and +/-inf included).The value
x, exactly.truefor NaN.trueforinfor-inf.trueunless infinite or NaN.truefor0.0or-0.0.truewhen the sign is negative (-0.0too).The magnitude.
The nearest
f64: +/-inf pastf64::MAX, ties to even into the subnormals, +/-0 below them.nonewhen a finite value is pastf32's range; a finite value inside it rounds.The nearest
floatton(ties to even).Truncated toward zero;
nonefor NaN / +/-inf.
Trait implementations 19
impl Add for Floatimpl Sub for Floatimpl Mul for Floatimpl Div for Floatimpl Rem for Floatimpl Modulo for Floatimpl Neg for Floatimpl PartialEq for Floatimpl PartialOrd for Floatimpl Clone for Floatimpl Copy for Floatimpl Default for Floatimpl Zero for Floatimpl One for Floatimpl Display for Floatimpl Debug for Floatimpl FromStr for Floatimpl From<f32> for Floatimpl From<f64> for Float