THIS Python behaviour is WEIRD… #python #coding #howto

preview_player
Показать описание
If you enjoy my content, consider supporting me on Patreon or becoming a member!

If you need help with anything, feel free to join the Discord server:

I get a lot of people asking, so here's my Visual Studio Code setup!



If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.

#python #coding #howto
Рекомендации по теме
Комментарии
Автор

Is this weird *Python* behavior? Floating point errors exist in basically every language.

Sam-qkgy
Автор

Decimal cut the last digits. It doesn't add precision. It just doesn't show it as much as I know

CasperioSs
Автор

Nope, they don't have infinite precision, instead it calculates a fixed number of digits. It would not, for example, be able to calculate the area of a circle with an integer radius exactly (duhh). All it does is store and calculate decimal digits instead of binary digits.

amos
join shbcf.ru