This is a prime factorization calculator: http://www.mathwarehouse.com/arithmetic/numbers/prime-number/prime-factorization-calculator.php
When I enter a number in it, and then click on "Calculate", my computer will try to divide it by every prime number (up to its square root) to get its prime factorization.
But my question concerns what happens when I input a very big number...
Mozilla Firefox freezes and then crashes miserably.
But why? What was my computer thinking? Couldn't it realize that the number is too big and that there's no way he will succeed? And therefore why couldn't it just stop calculating instead of freezing and then crashing?
If I ask you to jump out of a window, you will evaluate the situation first, and then you will tel me: "no I won't, the height is too big". Likewise, when I ask my computer to calculate the prime factorization of a ridiculously big number, why can't it tell me: "no I won't, the number is too big"?
My computer just blindly calculates, never once hesitating, never once retreating, until it crashes into the big brick wall...
It crashes because of a bug in the page software
Actually, the page does try to detect this condition. If you look at the source it says
mw_translateObject['large1'] = "This is a very large number. The calculator may or may not be able to break it down before timing out."
If you enter a very large number and it crashes instead of displaying this message then it is a bug...