Comment on Java

<- View Parent
BorgDrone@lemmy.one ⁨1⁩ ⁨year⁩ ago

You wouldn’t need floor/ceil for that. Casting a double to an int is already predictable as the java language spec explicitly says how to do it, so any JVM will do this the exact same way.

The floor/ceil functions are simply primitive math operations and they are meant to be used when doing floating point math.

source
Sort:hotnewtop