+ 1
what is the output of this JavaScript Code? alert (125 ** (1/3) );
why it is not 5??
3 Antworten
+ 3
You are right about it being cube root
alert(Math.pow(125,1/3))
1/3 results in 0.33333 ,maybe that's why having it doesn't rounds of to 5 and instead prints 4.9999 like 1.9999 for 8
+ 2
I thought ** 1/3 means cube root ...& cube root of 125 is 5....that's why I asked....I am learning JavaScript ...so don't know how it works yet...
+ 2
then why 8 ** (1/3) is equal to 2 ? ......it also should be 1.99999 ?