Change


British Coins

I was re-reading Isaac Asimov's, Realm of Numbers and saw a few examples of working with the old British system of coinage and figured I'd try my hand at putting together a very simple calculator.

The rules are a bit complicated compared to the US system:

Here is a very sloppy alpha version I put together.

Internally I limit my accuracy to farthings, and normalize the result. A bare minimum of sanity checking is done. I commit the cardinal sin of C programming and use scanf for inputting the currency amounts. It appears to work for the examples I've fed it from the book. As usual garbage in yields garbage out.

I just did a minor update to fix a logic problem with the input. It will now accept currency amounts as long as at least one value is greater than zero. I also added a short README for changes.

The Code

Download

M. Chappell 16 November 2025


Sunday, 16 November 2025   Michael J. Chappell   Contact me at: mcsuper5@freeshell.org Made with Emacs