purescript-deprecated / purescript-math

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

Add `trunc`, with a polyfill for browsers that don't support it. #12

Closed rgrempel closed 8 years ago

rgrempel commented 8 years ago

Of course, you can implement this in plain-old-purescript, but it's likely that the native browser method is faster, when available. And I've included a polyfill for cases where it's not available (mainly IE, according to this page)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc

rgrempel commented 8 years ago

I re-pushed the commit with a small whitespace change -- jscs was otherwise complaining about whitespace.

garyb commented 8 years ago

Thanks!