alphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 11 months agoJavalemmy.worldimagemessage-square78fedilinkarrow-up1582arrow-down148
arrow-up1534arrow-down1imageJavalemmy.worldalphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 11 months agomessage-square78fedilink
minus-squareLmaydev@programming.devlinkfedilinkarrow-up4·11 months agoBecause ints are way smaller. Over a certain value it would always fail.
minus-squarelarvyde@sh.itjust.workslinkfedilinkarrow-up1·11 months agoYea but at those values floating points can’t represent fractions anyway
minus-squareLmaydev@programming.devlinkfedilinkarrow-up1·11 months 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.