FastTrigo icon indicating copy to clipboard operation
FastTrigo copied to clipboard

Wrong values with large float32s

Open GregoryMorse opened this issue 1 year ago • 0 comments

The method of casting to int32 and back to float32 to perform a round-to-nearest even floor, is invalid if the number is greater than or equal to +2^31 or strictly less than -2^31. The result of fmod should be zero (in fact at magnitudes of +/-2^24 this is already guaranteed by the mantissa limitation), yet it seems in this library that undefined behavior would occur as this is not checked. Therefore though claiming to be fast, it is also taking a sloppy shortcut so as to not be universal in values outside that range of float values when we know float32 has a range of around -2^127 to 2^127

GregoryMorse avatar Jul 09 '24 22:07 GregoryMorse