Brunsviga 18RK

I’ve bought a Brunsviga 18RK mechanical calculating machine, since it is a piece of computing history.  Here it is:

brunsviga18rk

It is awesome and I can report that everything seems to work.  It can’t do negative numbers, so I have enjoyed doing things like entering 100 and then subtracting 150  to get a result of 9999999999950. That’s called underflowing the accumulator, and a bell rings when you do it.

In its honour, I have also written this C program:

#include <stdio.h>
 
int main(int argc, char *argv[])
{
  unsigned char test='A';
 test-=66;
 printf("%d%c\n",test,7);
 return 0;
}

…which underflows an unsigned char, subtracting 66 from 65 to get a result of 255.  For the sake of completeness I’m printing ACSII code 7 at the same time, so that a bell also sounds.  I’m sorry.