537
Java (lemmy.world)
submitted 2 years ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 4 points 2 years ago

Because ints are way smaller. Over a certain value it would always fail.

[-] [email protected] 1 points 2 years ago

Yea but at those values floating points can't represent fractions anyway

[-] [email protected] 1 points 2 years ago

Exactly. So if cast to int you'd either get an error or 0 for everything above a certain value.

this post was submitted on 05 Aug 2023
537 points (92.4% liked)

Programmer Humor

23899 readers
658 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