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-squarebaseless_discourse@mander.xyzlinkfedilinkarrow-up2·edit-22 years ago“predictable” in the sense that people know how it works regardless what language they know. I guess I mean “no surprise for the reader”, which is more “readability” than “predictability”
minus-squareBorgDrone@lemmy.onelinkfedilinkarrow-up3·2 years agoIs there any language that doesn’t just truncate when casting from a float to an int?
minus-squarebaseless_discourse@mander.xyzlinkfedilinkarrow-up4·edit-22 years agoAs far as I know, haskell do not allow coresion of float to int without specifying a method (floor, ceil, round, etc): https://hoogle.haskell.org/?hoogle=Float±%3E+Integer&scope=set%3Astackage Agda seems to do the same: https://agda.github.io/agda-stdlib/Data.Float.Base.html
“predictable” in the sense that people know how it works regardless what language they know.
I guess I mean “no surprise for the reader”, which is more “readability” than “predictability”
Is there any language that doesn’t just truncate when casting from a float to an int?
As far as I know, haskell do not allow coresion of float to int without specifying a method (floor, ceil, round, etc): https://hoogle.haskell.org/?hoogle=Float±%3E+Integer&scope=set%3Astackage
Agda seems to do the same: https://agda.github.io/agda-stdlib/Data.Float.Base.html