Variable Precision Integer Arithmetic.

Last Up date: 2010 November 17
Recent changes: Brief list of latest versions 2003 November 20 for www.laforth.com

In 1993 I wanted to convert some powers of ten to hex. Because the tables I had did not go big enough I decided to write a program to convert almost any size decimal number to hex. (The only limit was the size of memory.) I called it DH for Decimal to Hex. All that DH did for each digit was to multiply what it had by ten and add on the next digit, until all the digits were done. Initially, I just looked at the result using the DOS DEBUG command.

Of the four basic arithmetic functions, division is (as we learned in grade school) the most difficult, and in many ways the most interesting. In the world of integers, division gives two values for an answer. In most electronic calculators and even programing languages the Remainder is treated like an unwanted cousin.

Forth is the only language I am aware of that conveniently provides both values for an integer divide. (Except Assembly of course.)

The Remainder is valuable, sometimes more valuable than the Quotient. And sometimes you want both. Here is an example.

For some time I had felt it would be nice to have an integer calculator. One that would give two answers to a divide. So I renamed DH to IA for Integer Arithmetic.


Contact me at:
My phone #'s
For comments call, or e-mail me. Go to My Home Page or TOP of this page.