← Back to context

Comment by clark_dent

2 hours ago

Could you humor a coding noob--how do you deal with utterly insane inputs like that?

Arbitrary precision arithmetic (GMP, BigInteger, etc). Numbers can take arbitrary amounts of memory, instead of just a single machine word.

Crash and report an error.

  • You report an error and exit cleanly with a proper operating system error code. Crashing is a quick hack, acceptable for throwaway projects but not in software used long-term.