#how to check if a specific float can be losslessly converted to the specified integer type?
1 messages · Page 1 of 1 (latest)
Not sure this is the best way (since you only want to check if a fractional portion exists, not necessarily retain the fractional value), but you can get both the integer and fractional values of a float using std.math.modf: https://ziglang.org/documentation/master/std/#A;std:math.modf
std.math.lossyCast and check if it is equal?