如何在Math.js的表达式语法中输入power根?在AsciiMath中,我可以输入"-root(3)(x+4)-4“。如何在Math.js的表达式语法中获得相同的结果?
发布于 2022-10-22 18:27:48
我将尝试编写一个实时代码来回答这个问题。它就是
-nthRoot(x+4,3)-4正如@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>
https://stackoverflow.com/questions/70776259
复制相似问题