alphacyberranger to Programmer Humor@programming.devEnglish • 1 year agoJavalemmy.worldimagemessage-square76fedilinkarrow-up1579arrow-down148
arrow-up1531arrow-down1imageJavalemmy.worldalphacyberranger to Programmer Humor@programming.devEnglish • 1 year agomessage-square76fedilink
minus-square@BorgDrone@lemmy.onelinkfedilink3•1 year agoIs there any language that doesn’t just truncate when casting from a float to an int?
minus-square@baseless_discourse@mander.xyzlinkfedilink4•edit-21 year 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
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