Convert double to long if lossless

Ali Çehreli acehreli at yahoo.com
Tue Jan 19 15:50:04 UTC 2021


On 1/19/21 6:04 AM, drug wrote:

 > Another (low level) way is to shift mantissa left by exponent value.

Luckily, we already have a helper in Phobos:

   https://dlang.org/phobos/std_bitmanip.html#FloatRep

Ali



More information about the Digitalmars-d-learn mailing list