Possible duplicate:Python float - str-float weirdness
In python 2/5.0or 2/float(5)returns0.40000000000000002
2/5.0
2/float(5)
0.40000000000000002
Why am I getting this error at the end and how can I get the correct value for use in advanced calculations?
Welcome to IEEE754, enjoy your stay .
Use instead decimal.
decimal
. , . , , .
.
IEEE . , , .
. , . , - , , .
, , . Python - , , .
:
- "" . , , . .
-, , . , , ?
, Python 3.1 , . . Python 3.1 ( " " ).
See this question for an explanation. The right way is either
Source: https://habr.com/ru/post/1732504/More articles:Silverlight user control inheritance. Reusing a template? - inheritanceКак CRichEditCtrl знает операцию вставки? - c++How to get an MFC application to bypass UAC in Windows 7 and Vista - visual-c ++Selecting thumbnails from external links - phpHow can I get fonts for text from a client PC using a Java applet? - javaIs it possible to change the stack size dynamically - how? - cCSS - Multiple 100% div height? - htmlWhat is the correct way to subclass MFC management? - c ++TweetSharp get the number of subscribers - .netЕсть ли эквивалент typedef в Transact-SQL? - sqlAll Articles