307
submitted 5 months ago* (last edited 5 months ago) by Avicenna@programming.dev to c/programmer_humor@programming.dev

A NaN spotted in the wild.

you are viewing a single comment's thread
view the rest of the comments
[-] NotSteve_@lemmy.ca 45 points 5 months ago

THE PRICE TAGS ARE RUNNING JAVASCRIPT!!

[-] Orygin@sh.itjust.works 30 points 5 months ago* (last edited 5 months ago)

NaN are not exclusive to JavaScript, it's more scary that they're using floating point numbers for monetary value.
If you buy something at -Inf, do they empty the business bank account into yours?

[-] verdare@piefed.blahaj.zone 13 points 5 months ago

Eh, it’s not a problem if prices are being converted to floating point at some point before being displayed.

What you don’t want to do is store the definitive price as a floating point and perform calculations with it. I don’t see any reason to assume that’s happening here.

[-] sik0fewl@piefed.ca 3 points 5 months ago* (last edited 5 months ago)

It still makes no sense to convert to float and is likely to lead to a big at some point

this post was submitted on 28 Jun 2026
307 points (99.7% liked)

Programmer Humor

34376 readers
748 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS