0
Why does this return 1.0 as output.
print(9.0**(1.0//2.0)).. Output should be 9.0 right??
3 odpowiedzi
+ 1
1.0//2.0 returns a 0, and 9.0**0 is equal to 1.0
0
simple bro... single / is produce quotient and double // is produce remainder. so 1.0/2.0=2.0 then 9.0**2.0=3.0 then
1.0//2.0=0.0 then 9.0**0.0=1.0
- 1
9 to power 0 is 1
(9 to power 1 is 9)