alphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · il y a 3 ansJavalemmy.worldimagemessage-square76linkfedilinkarrow-up1581arrow-down148
arrow-up1533arrow-down1imageJavalemmy.worldalphacyberranger@lemmy.world to Programmer Humor@programming.devEnglish · il y a 3 ansmessage-square76linkfedilink
minus-squareBorgDrone@lemmy.onelinkfedilinkarrow-up3·il y a 3 ansIs there any language that doesn’t just truncate when casting from a float to an int?
minus-squarebaseless_discourse@mander.xyzdeleted by creatorlinkfedilinkarrow-up4·il y a 3 ansAs 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