0

simple question is there an operator for the root as for the power there's the "* *".

I tried to search but I couldn't find it, so I don't think there is, but if for any reason I didn't saw but it exist can someone please tell? thx

2 Answers2

0

The root is just the power of the inverse, so you can also do:

n ** (1 / x)

Or use Math.pow:

Math.pow(n, 1 / x)
Luan Nico
  • 5,376
  • 2
  • 30
  • 60
-1

Use Math.sqrt(). There is no operator for it, but instead a function exists.

soshimee
  • 368
  • 2
  • 9
  • yeah, i know, but i have to do an exercise where i have to make a calculator using html css and jquery for frontend, then i have to use AJAX and csharp to make the calculation on the server side using a handler.ashx. I know it's useless but it's because i'm new to csharp, ajax, and jquery. for now i'm just trying to make it without the AJAX and csharp and handler part, to see if i can do it, but i'm using an eval() function that read what's on the display and solve what's there, this is the reason why I needed "**" and not math.pow, same thing for the root. but thanks for the answer – Filippo Canino Apr 01 '22 at 09:00