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?

  • 2
    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
    Commented Jun 22, 2019 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
    Commented Jun 22, 2019 at 8:43
  • 2
    @tofro, btw, isn't your first comment an answer? Some did, but not all.
    – UncleBod
    Commented Jun 22, 2019 at 15:27
  • 2
    @tofro Yeah; you should probably write that up as an answer, since answering in comments is problematic.
    – wizzwizz4
    Commented Jun 24, 2019 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
    Commented Jun 28, 2019 at 18:02


You must log in to answer this question.

Browse other questions tagged .