1

How do you enter a power root in Math.js' expression syntax? In AsciiMath I can enter "-root(3)(x+4)-4". How can I get the same result in the expression syntax of Math.js?

enter image description here

  • I think the docs say: `-nthRoot(x+4,3)-4` (see: https://mathjs.org/docs/reference/functions/nthRoot.html ) – Luuk Jan 19 '22 at 19:18

1 Answers1

0

I will attempt to write a live code to answer the question. And it is

-nthRoot(x+4,3)-4

as commented by @Luuk.

// Use this function to show values of matrix and etc.
function print (value) {
  const precision = 14
  console.log(math.format(value, precision))
}
print("Start MathJS test.")
//print(math.round(math.e, 3))     // 2.718
let x = 23
print( -math.nthRoot(x+4,3) -4 )   // -7
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/11.3.1/math.js"></script>
swatchai
  • 17,400
  • 3
  • 39
  • 58