alphacyberranger to Programmer HumorEnglish • 11 months agoJavalemmy.worldimagemessage-square77fedilinkarrow-up1587arrow-down148
arrow-up1539arrow-down1imageJavalemmy.worldalphacyberranger to Programmer HumorEnglish • 11 months agomessage-square77fedilink
minus-square@[email protected]linkfedilink15•11 months agoAFAIK most typed languages have this behaviour.
minus-square@Lmaydevlink4•11 months agoBecause ints are way smaller. Over a certain value it would always fail.
minus-squarelarvydelinkfedilink1•11 months agoYea but at those values floating points can’t represent fractions anyway
minus-square@Lmaydevlink1•11 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.