C:\home\dexcube\Development\piper\build> python3
Python 3.13.2 (main, Mar 13 2025, 14:29:07) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal
>>> Decimal('0.1') + Decimal('0.2')
Decimal('0.3')
this post was submitted on 05 Apr 2025
17 points (94.7% liked)
Programmer Humor
34912 readers
98 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
I looked into this at some point in the past.
From memory, despite 0.3 being unrepresenatable, the routine that formats the output rounds it (stringily) to 0.3.
Someone can correct me, because it's only a vague memory at this point.
> C:\
> on linux
Absolutely illegal.
I use the Chicago95 XFCE theme, which modifies the bash prompt.
I mean sure, I can do this with Clojure too
Babashka v1.12.197 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (float (+ (/ 1 10) (/ 2 10)))
user=> 0.3