-
Hey, it's me again with yet another weird question 👋 if (String(inputExpression).replaceAll(" ", "").includes("0^0")){
throw new Error("0^0 is undefined");
} but that fails for a.) different notations like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
😂 hi! You'll have to replace the implementation of For example: const originalPow = math.pow
function customPow(x, y) {
if (math.isZero(x) && math.isZero(y)) {
return undefined
}
return originalPow(x, y)
}
math.import({ pow: customPow }, { override: true })
console.log('result:', math.evaluate('0^0')) // undefined |
Beta Was this translation helpful? Give feedback.
😂 hi!
You'll have to replace the implementation of
math.pow
with your own version, that handles the case of0^0
like you want.For example: