Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

python division precision error

Правка en1, от ibrahim129, 2021-11-19 04:26:09

I was doing some float operations using python. But when I tried to divide 9999999999999999 by 2 (9999999999999999/2) I got 5000000000000000.0 which is wrong. I already know the issue 8.6-8.4 != 0.2 (issue with binary representation) but I couldn't figure out what is the issue. Can anyone explain this?

Теги python, floating number

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ibrahim129 2021-11-19 04:26:09 334 Initial revision (published)