alphacyberranger to Programmer [email protected]English • 10 months agoJavaimagemessage-square75arrow-up1581arrow-down145
arrow-up1536arrow-down1imageJavaalphacyberranger to Programmer [email protected]English • 10 months agomessage-square75
minus-square@[email protected]linkfedilink4•10 months agoBecause ints are way smaller. Over a certain value it would always fail.
minus-squarelarvydelinkfedilink1•10 months agoYea but at those values floating points can’t represent fractions anyway
minus-square@[email protected]linkfedilink1•10 months agoExactly. So if cast to int you’d either get an error or 0 for everything above a certain value.
AFAIK most typed languages have this behaviour.
Because ints are way smaller. Over a certain value it would always fail.
Yea but at those values floating points can’t represent fractions anyway
Exactly. So if cast to int you’d either get an error or 0 for everything above a certain value.