This useless javascript module does mathematical operations on numbers.
const math = require('@useless-javascript-modules/math')
math.add(1,2) /* = 3 */
math.subtract(6.2,4) /* = 2.2 */
math.multiply(2,3) /* = 6 */
math.divide(10,3) /* = 3.3333.... */
math.pow(3,3) /* = 27 */
math.root(27,3) /* = 3 */
Add the first argument to the second argument
Subtract the second argument from the first argument.
Multiply the first argument by the second argument
Divide the first argument by the second argument
The first argument raised to the power of the second argument
The first argument to the root of the second argument
- 3.0 - Changed API to make it "better"
- 2.1 - Added
pow
androot
operations - 2.0 - Operations now accurately handles fractional numbers
- 1.1 - Added support for multiply and divide operations
- 1.0 - initial release