+ 1

Why would 7.0 be stored as a float if its still a whole number?

Why is 7.0 stored as a float

2nd Dec 2016, 9:11 AM
Shak M
Shak M - avatar
5 Antworten
+ 5
Yeah sorry I forgot to check the tag. Python types dynamically apparently (just saw that in the python tutorial) so it is because you add the decimal point.
2nd Dec 2016, 10:30 AM
Karl T.
Karl T. - avatar
+ 3
Because it is stored as a float when you declare it as a 'float'.
2nd Dec 2016, 9:26 AM
Karl T.
Karl T. - avatar
+ 2
@Karl I think he's referring to Python. 7.0 is a float because it contains a decimal point.
2nd Dec 2016, 10:25 AM
Samuel Neo
Samuel Neo - avatar
0
ha correct
8th Dec 2016, 10:29 AM
Akshay Gupta
Akshay Gupta - avatar
0
thanks
6th May 2017, 8:51 AM
Shak M
Shak M - avatar