5

I just saw this video of a mechanical calculator dividing by zero. Did any mechanical calculators or computers ever provide for a failure mode on divide by zero? Or did they always handle it by looping infinitely?

Did any of them have a certain check for the division, or error out on a certain amount of iterations?

  • 1
    Given that mechanical calculators would divide by repeated subtraction, possibly with shift, the natural reaction is a loop. Is it worthwhile to add additional mechanics to check for zero, and increase the price of the thing compared to the competition, when the user can easily make sure he never divides by zero? Probably not. So would mechanical calculators exist with this extra check? Probably not. – dirkt Jun 22 '19 at 7:34
  • It's actually pretty easy to error out on overflow - Simply check for a carry on the uppermost digit and stop the machine. Not a big technical challenge. Some of the late Walthers I've seen that could do division had this. – tofro Jun 22 '19 at 8:43
  • 2
    @tofro, btw, isn't your first comment an answer? Some did, but not all. – UncleBod Jun 22 '19 at 15:27
  • 2
    @tofro Yeah; you should probably write that up as an answer, since answering in comments is problematic. – wizzwizz4 Jun 24 '19 at 9:45
  • 1
    Not an answer, but this is reasoning why RISC-V defines that division by 0 causes quotient of all 1 bits. In binary, no need to cycle around each digit, but comparison rem>=shifted_divisor is always true. – Netch Jun 28 '19 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.