mazze.js
Version:
next gen javascript math library!
22 lines (20 loc) • 963 B
JavaScript
const defaultFunctions = require('./default')
const errHandler = require('../Utils/errHandler')
module.exports = {
cuboidVolume: function(x , y, z) {
if(!x) return errHandler.new("cuboidVolume" , "x" , "5 , 4 , 6")
if(!y) return errHandler.new("cuboidVolume" , "y" , "5 , 4 , 6")
if(!z) return errHandler.new("cuboidVolume" , "z" , "5 , 4 , 6")
if(!Number.isInteger(x)) return errHandler.invalid("Make sure (x) is a integer.")
if(!Number.isInteger(y)) return errHandler.invalid("Make sure (y) is a integer.")
if(!Number.isInteger(z)) return errHandler.invalid("Make sure (z) is a integer.")
let ans = +x * +y * +z
return ans
},
cubeVolume: function(a) {
if(!a) return errHandler.new("cubeVolume" , "a" , "5")
if(!Number.isInteger(a)) return errHandler.invalid("Make sure (a) is a integer.")
let ans = +a * +a * +a
return ans
}
}