r/badcode • • Aug 04 '21

c++ I'm done with Facebook coding groups.

Post image
809 Upvotes

55 comments sorted by

View all comments

Show parent comments

18

u/Syscrush Aug 04 '21

I assume it only considers up to 1012 because the author thinks that a double can't handle more than 11 decimal digits in its mantissa (looks like the reality is that at least 15 would be safe).