2 ms·
C:\>python Python 2.7.3 (default, May 4 2017, 16:44:54) [MSC v.1600 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more
by hathym 9y ago
C:\>python
Python 2.7.3 (default, May 4 2017, 16:44:54) [MSC v.1600
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> 0.1+0.2==0.3
False
- ryebit 9y agoA more direct comparison given perl6's typing would be either [python] >>> from decimal import Decimal >>> Decimal("0.1") + Decimal("0.2") == Decimal("0.3") True or [python] >>> 0.3 == 3e-1 True What the perl6 "0.3 != 3e-1" comparison is really doing is [python] >>> from decimal import Decimal >>> Decimal("0.3") == 3e-1 False
- Sean1708 9y agoI understand why decimal notation returns a rational, I'm wondering why exponential notation doesn't.