this post was submitted on 05 May 2025
435 points (98.9% liked)

Programmer Humor

23040 readers
1985 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] FiskFisk33@startrek.website 2 points 8 hours ago

oh god the reason is even stupider then I expected

Because large numbers use the e character in their string representation (e.g., 6.022e23 for 6.022 × 1023), using parseInt to truncate numbers will produce unexpected results when used on very large or very small numbers. parseInt should not be used as a substitute for Math.trunc().