Lines Matching full:mantissa
24 // sign × mantissa × 2**exponent
26 // with 0.5 <= mantissa < 1.0, and MinExp <= exponent <= MaxExp.
32 // The precision is the maximum number of mantissa bits available to
34 // be rounded to fit into the mantissa bits, and accuracy describes the
96 // Internal representation: The mantissa bits x.mant of a nonzero finite
98 // the slice may (but doesn't have to) be shorter if the mantissa contains
100 // the msb is shifted all the way "to the left"). Thus, if the mantissa has
102 // x.mant[0] has trailing zero bits. The msb of the mantissa corresponds
110 // 0 < |x| < +Inf finite sign mantissa exponent
154 // value of z. Rounding occurs according to z's rounding mode if the mantissa
200 // Prec returns the mantissa precision of x in bits.
245 // MantExp breaks x into its mantissa and exponent components
247 // provided its value is set to the mantissa of x, with the
259 // mantissa value.
349 return x.prec <= uint32(x.exp) || x.MinPrec() <= uint(x.exp) // not enough bits for fractional mantissa
363 panic("nonzero finite number with empty mantissa")
376 // have before calling round. z's mantissa must be normalized (with the msb set)
395 m := uint32(len(z.mant)) // present mantissa length in words
396 bits := m * _W // present mantissa bits; bits > 0
398 // mantissa fits => nothing to do
405 // z.prec leading mantissa bits (the "0.5"). The sbit is set if any
415 // bits > z.prec: mantissa too large => round
426 n := (z.prec + (_W - 1)) / _W // mantissa length in words for desired precision
432 // determine number of trailing zero bits (ntz) and compute lsb mask of mantissa's least-significant word
438 // Make rounding decision: The result mantissa is truncated ("rounded down")
440 // mantissa.
465 // add 1 to mantissa
467 // mantissa overflow => adjust exponent
474 // adjust mantissa: divide by 2 to compensate for exponent adjustment
476 // set msb == carry == 1 from the mantissa overflow above
554 fmant, exp := math.Frexp(x) // get normalized mantissa
563 // fnorm normalizes mantissa m by shifting it to the left
568 panic("msw of mantissa is 0")
835 mbits = 23 // mantissa size (excluding implicit msb)
843 // Float mantissa m is 0.5 <= m < 1.0; compute exponent e for float32 mantissa.
844 e := x.exp - 1 // exponent for normal mantissa m with 1.0 <= m < 2.0
846 // Compute precision p for float32 mantissa.
848 // rounding and fewer than p mantissa bits of precision available
849 // (the exponent remains fixed but the mantissa gets shifted right).
854 // If p == 0, the mantissa of x is shifted so much to the right
856 // mantissa space. In other words, if the smallest denormal is
857 // considered "1.0", for p == 0, the mantissa value m is >= 0.5.
860 // If p < 0, the mantissa value m is <= "0.25" which is never rounded up.
899 // Determine sign, biased exponent, and mantissa.
955 mbits = 52 // mantissa size (excluding implicit msb)
963 // Float mantissa m is 0.5 <= m < 1.0; compute exponent e for float64 mantissa.
964 e := x.exp - 1 // exponent for normal mantissa m with 1.0 <= m < 2.0
966 // Compute precision p for float64 mantissa.
968 // rounding and fewer than p mantissa bits of precision available
969 // (the exponent remains fixed but the mantissa gets shifted right).
974 // If p == 0, the mantissa of x is shifted so much to the right
976 // mantissa space. In other words, if the smallest denormal is
977 // considered "1.0", for p == 0, the mantissa value m is >= 0.5.
980 // If p < 0, the mantissa value m is <= "0.25" which is never rounded up.
1019 // Determine sign, biased exponent, and mantissa.
1091 // shift mantissa as needed
1185 panic("empty mantissa for x")
1188 panic("empty mantissa for y")
1194 // x and y must have a non-empty mantissa and valid exponent.
1210 // compute exponents ex, ey for mantissa with "binary point"
1211 mantissa.0) - use int64 to avoid overflow
1248 // x and y must have a non-empty mantissa and valid exponent.
1301 // x and y must have a non-empty mantissa and valid exponent.
1324 // x and y must have a non-empty mantissa and valid exponent.
1330 // mantissa length in words for desired result precision + 1
1369 // x and y must have a non-empty mantissa and valid exponent.