reasonml-community / belt

MIT License
49 stars 1 forks source link

add `round` function #13

Open bsansouci opened 6 years ago

bsansouci commented 6 years ago

Someone recently asked for round which doesn't exist. It's not super clear what the best default implementation would be, probably following JS's behavior.

For reference, a dumb implementation could be let frnd f => f < 0. ? ceil (f -. 0.5) : floor (f +. 0.5);.