0

why 3**2=32 and not 32.0 and why 9**(1/2)=3.0 and not 3? plz explain

27th Jul 2019, 8:17 AM
Dhyey Badheka
Dhyey Badheka - avatar
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
27th Jul 2019, 9:38 AM
MXE
MXE - avatar
+ 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".
27th Jul 2019, 10:45 AM
MXE
MXE - avatar
+ 1
3**2 gives 9 not 32 - according to Code Playground ...
27th Jul 2019, 8:27 AM
Ipang
0
its not like that
27th Jul 2019, 8:28 AM
Dhyey Badheka
Dhyey Badheka - avatar
0
plz watch tutorial for that
27th Jul 2019, 8:28 AM
Dhyey Badheka
Dhyey Badheka - avatar
0
9**(1\\2) , now I m getting error in this too
27th Jul 2019, 10:31 AM
Dhyey Badheka
Dhyey Badheka - avatar