purescript-deprecated / purescript-math

Math functions
BSD 3-Clause "New" or "Revised" License
19 stars 20 forks source link

ceil, floor, round should be Number -> Int #7

Closed EugeneN closed 8 years ago

EugeneN commented 9 years ago

ceil, floor, round should be Number -> Int ?

garyb commented 9 years ago

Unfortunately not, as Ints are restricted to a 32 bit range (in the JS backend at least), but ceil, floor, and round can deal with integers-as-Number between -9,007,199,254,740,991 and 9,007,199,254,740,991.

EugeneN commented 9 years ago

well how can one convert Number to Int then?

garyb commented 9 years ago

https://github.com/purescript/purescript-integers/blob/master/docs/Data/Int.md#fromnumber

sharkdp commented 8 years ago

I think this can be closed.