...
This code produces the following output on implementations that use IEEE 754 floats
Code Block |
---|
Original : 3.333333e-01 Denormalized? : 2.802597e-45 Restored : 4.003710e-01 |
...
Code Block |
---|
Original : 3.333333e-01 Denormalized? : 2.333333e-45 Restored : 3.333333e-01 |
If using doubles also produces denormalized numbers, using long doubles might help or it might not (on some implementations long double has the same exponent range as double). If using long doubles produces denormalized numbers, some other solution must be found.
...