On 1/19/21 4:48 PM, Per Nordlöw wrote:
On Tuesday, 19 January 2021 at 13:36:58 UTC, Steven Schveighoffer wrote:Use a cast instead.const lvalue = cast(long)value;Ahh, good point. Followd by a compare of the original value I presume.
don't forget to check by std.math.isFinite before castingAnother (low level) way is to shift mantissa left by exponent value. If the remainder equals to zero then no fractal part was encoded in the floating value.