+ 2
In Idle, if I sum 4+1.065 I get 5.0649999999995. Why?
3 Respostas
+ 3
because float values are not stored in computers as exact values . when you tell your PC to add 1.065 to an integer the PC will add some value very close to 1.065 .. in some cases you may get lucky but mostly you won't
+ 2
yeah,because of the specificity of float.for exampl,if you do 1.1+1.1+1.1 ,the answer will be 3.3000000000x,while not 3.3.
0
wait what? i still dont get the answer. so i don't get why python cant even calculate numbers right. that seems pretty simple. or, is pythons answer actually right and i need to interpret addition differently? like, python cant just suck at arithmetic