You're viewing a single thread.
All Comments
77 comments
Acetamide @lemmy.world
AFAIK most typed languages have this behaviour.
15 0 ReplyLmaydev @programming.dev Because ints are way smaller. Over a certain value it would always fail.
4 0 Replylarvyde @sh.itjust.works Yea but at those values floating points can't represent fractions anyway
1 0 ReplyLmaydev @programming.dev Exactly. So if cast to int you'd either get an error or 0 for everything above a certain value.
1 0 Reply
77 comments
Scroll to top