- 2
Why 9**1/2 results a float number while 9**2 results an integer? In python
4 odpowiedzi
+ 3
9**2=18
thats an integer.
but in your 2nd:
you think the cpu is doing:
9**(1/2)
when its actually doing:
(9**1)/2
so output is 4.5
+ 2
also 9**(1/2) is 3.0
using the exponential operator on fractions or negative numbers results in a float
0
I believe Python sees (1/2) as 0.5 which is a float.
- 1
Thanks brother