UNPKG

true-math

Version:

True Math - math library for numbers of arbitrary length

13 lines (11 loc) 196 B
import {sign} from './helpers.js'; export default function changeSign(num) { switch (sign(num)) { case -1: return num.slice(1); case 0: return num; case 1: return '-' + num; } }