+ 2
Why this happens to floats?
Hey guys, can anyone figure out why the result of this simple operation comes out wrong ? (this a part of a bigger program) btc = 0.00325911 doge = 0.431001 total = btc + doge print(total) #output : 0.43426011000000003 Normally if we add those two numbers, the result is definitely different (0.43426011); but why in here it’s miscalculated ? Thanks in advance for the answers🙏🏻
1 Antwort
+ 2
Please use search bar before Asking
https://www.sololearn.com/discuss/504630/?ref=app
https://www.sololearn.com/discuss/2836685/?ref=app
https://www.sololearn.com/discuss/2011017/?ref=app
https://www.sololearn.com/discuss/711763/?ref=app
https://www.sololearn.com/discuss/2779840/?ref=app
https://www.sololearn.com/discuss/1431710/?ref=app
https://www.sololearn.com/discuss/1733175/?ref=app
https://www.sololearn.com/discuss/1288636/?ref=app
https://www.sololearn.com/discuss/72830/?ref=app
https://www.sololearn.com/discuss/2311964/?ref=app
https://www.sololearn.com/discuss/493032/?ref=app