Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am torbatian on github.
  • I am torbatian (https://keybase.io/torbatian) on keybase.
  • I have a public key ASCrayddkJ2sOYG3kAgIL6-Ya4FON7iyAjIVY4QTl9vsAAo

To claim this, I am signing this object:

@torbatian
torbatian / math.js
Created January 10, 2018 13:49
Ceil10
Math.ceil10 = function (value, exp) {
if (typeof exp === 'undefined' || +exp === 0) {
return Math['ceil'](value)
}
value = +value
exp = +exp
// If the value is not a number or the exp is not an integer...
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
return NaN
}