alphacyberranger@lemmy.worldcake to Programmer Humor@programming.devEnglish · 3 years agoJavalemmy.worldimagemessage-square76linkfedilinkarrow-up1581arrow-down148
arrow-up1533arrow-down1imageJavalemmy.worldalphacyberranger@lemmy.worldcake to Programmer Humor@programming.devEnglish · 3 years agomessage-square76linkfedilink
minus-squareLmaydev@programming.devdeleted by creatorlinkfedilinkarrow-up4·3 years agoBecause ints are way smaller. Over a certain value it would always fail.
minus-squarelarvyde@sh.itjust.workslinkfedilinkarrow-up1·3 years agoYea but at those values floating points can’t represent fractions anyway
minus-squareLmaydev@programming.devdeleted by creatorlinkfedilinkarrow-up1·3 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.