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:

founded 5 years ago
MODERATORS
top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 week ago (3 children)
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')
[–] [email protected] 1 points 6 days ago

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.

[–] [email protected] 6 points 1 week ago (1 children)

> C:\
> on linux

Absolutely illegal.

[–] [email protected] 2 points 1 week ago

I use the Chicago95 XFCE theme, which modifies the bash prompt.

[–] [email protected] 1 points 1 week ago

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