0
why 3**2=32 and not 32.0 and why 9**(1/2)=3.0 and not 3? plz explain
6 Answers
+ 2
First of all, like Ipang said; 3**2 equals "9" NOT "32" ( 3 multiplied by 3 ).
and then, it gives an Integer as a result because the Inputs ( "3" and "2" ) are Integers.
Also, 9**(1/2) equals 3.0 because dividing 1 by 2 using "/" will always give a float as a result ( so it's "0.5" ) ----->> 3 ^ 0.5 equals "3.0"
Hope I helped you :P
+ 2
Printing "9**(1//2)" will result in "1" not error.
1 / 2 = 0.5
1 // 2 = 0 ((( numbers after decimal gets removed )))
So 9**0 (or) 9^0 equals to "1".
+ 1
3**2 gives 9 not 32 - according to Code Playground ...
0
its not like that
0
plz watch tutorial for that
0
9**(1\\2) , now I m getting error in this too