Closed Shoeboxam closed 6 months ago
If you use FBig
with default generic params, then the representation is in binary digits. That is, 0.1
is the floating point notation in base 2, which is equivalent to 0.5 in base 10. This is a desired behavior (documented here), though I will make it clearer in the user guide.
To diplay the number in decimal digits, you can convert it to DBig
using to_decimal()
, or convert it to f32
/f64
Ah, sorry, I wasn't expecting floats to print in base-2, but I guess it makes sense to print in the same B. Thanks for the lib as always!
The major reason I don't want to print in base-10 is that, base conversion can be pretty expensive, and I think it's better to make the conversion explicit,
The following code outputs
0.1
:However, the internal representation is correct. This passes and outputs
1 * 2 ^ -1 (prec: 53)
: