alphacyberranger@lemmy.world to Programmer HumorEnglish · 2 years agoJavalemmy.worldimagemessage-square77fedilinkarrow-up1589arrow-down148
arrow-up1541arrow-down1imageJavalemmy.worldalphacyberranger@lemmy.world to Programmer HumorEnglish · 2 years agomessage-square77fedilink
minus-squareLmaydevlinkfedilinkarrow-up4·2 years agoBecause ints are way smaller. Over a certain value it would always fail.
minus-squarelarvyde@sh.itjust.workslinkfedilinkarrow-up1·2 years agoYea but at those values floating points can’t represent fractions anyway
minus-squareLmaydevlinkfedilinkarrow-up1·2 years agoExactly. So if cast to int you’d either get an error or 0 for everything above a certain value.
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.