I just debugged a test failure down to different results on different JVMs:
Copy code
import kotlin.math.*
sin(85.05112877980658 * PI / 180)
ā¢
0.9962720762207499
(
Double.fromBits(0x3fefe175fa29280f)
) with Java 11 and Java 17 on Linux x86-64 as well as Java 11 on Apple Silicon
ā¢
0.99627207622075
(
Double.fromBits(0x3fefe175fa292810)
) with Java 17 on Apple Silicon
š 5
š 2
ephemient
02/03/2023, 1:35 PM
no, I'm not testing for equality, but I am testing that certain points remain in bounds after https://en.wikipedia.org/wiki/Web_Mercator_projection, and this one bit just happens to cause some other arithmetic to go wrong
ephemient
02/03/2023, 1:37 PM
anyhow, I ended up rewriting it in a more numerically-stable fashion, but it would have been convenient if there were some way to use
java.lang.StrictMath
instead of
java.lang.Math
from `kotlin.math.*`ā¦
ephemient
02/03/2023, 11:07 PM
speaking of which. have there been any proposals to allow for hexadecimal floating point literals in Kotlin like in several other languages? it would be clearer to talk about