alphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 2 years agoJavalemmy.worldimagemessage-square76fedilinkarrow-up1579arrow-down148
arrow-up1531arrow-down1imageJavalemmy.worldalphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · 2 years agomessage-square76fedilink
minus-squarelarvyde@sh.itjust.workslinkfedilinkarrow-up15·2 years agoint coerces to double automatically, without explicit casting
minus-squaresnake_baitmanlinkfedilinkarrow-up18·2 years agoThe CPU has to do real work to convert between float and int types. Returning an int type would just be giving the CPU extra work to do for no reason
minus-squareNotNotMike@programming.devlinkfedilinkarrow-up3·1 year agoI’m learning so much from this thread and I don’t even use Java
int
coerces todouble
automatically, without explicit castingThe CPU has to do real work to convert between float and int types. Returning an int type would just be giving the CPU extra work to do for no reason
I’m learning so much from this thread and I don’t even use Java