0
Wrong output problem :(
Can anyone tell me plz why there is lots of 0s followed by 2 next to the output ? Where did they really come from ? https://code.sololearn.com/cNJ4H0Q0nW0T/?ref=app
8 Answers
+ 3
Maybe cause first assigned value of X is double not float so final value will be also double that's why there r so many 0s .Hope this helps đđ»ââïž
+ 3
Mdy Try small even numbers!
This generally doesn't create a big problem!
If yes then you can ask me anytime! I ll love to help you!
+ 2
This is because it becomes hard for the system to calculate in decimals because it uses binary!
So the answer becomes a bit wrong
+ 2
BlueâéŁäșæ» python is not type strict!
That minor difference is coming due to the reason I have told
Mdy if you try smaller numbers:
print(6+2.345) => 7.345
(Caution: this difference becomes bigger when you use odd numbers)
+ 2
Maybe u r saying correct đ
+ 1
I tried using double n then removed it and it worked for me đ€·đ»ââïž
+ 1
Thanks
Doesn't this difference make any problem in more complicated codes ?
I tried smaller numbers , too and there was still some difference but less than the bigger numbers
+ 1
Yeah I tried and there were no difference this time .
Thanks for your help !