/arithmetic.js

fast, safe, reliable arithmetic functions

Primary LanguageJavaScriptThe UnlicenseUnlicense

arithmetic.js - fast, safe, reliable arithmetic functions

arithmetic.add(5, 4)
 9
arithmetic.subtract(10, 3)
 7
arithmetic.multiply(4, 4)
 16
arithmetic.divide(8, 2)
 4
arithmetic.divide(8, 0)
 ERROR: b is 0!
arithmetic.power(2, 3)
 8