Just had to share :) : Progammers Calculator for iPhone

Back in the late 80’s I bought a Casio CM100 Programmers calculator… It was solar powered and soon became my favorite go-to calculator for just about everything. Well it seems that after 35+ years, the LCD display finally gave it up… And since this calculator is no longer available (maybe on eBay), I decided to duplicate it as an iPhone app. I just finished the UI portion and I think it looks REALLY close to the original. Now its just a matter of making the buttons actually do something :slight_smile:

The final app will work on ALL models of iPhone, as well as “M” series mac desktops

10 Likes

This looks very fine, Sir!

Thanks… it is 100% Swift code, only image is the background for the display area, all the reset is standard ui controls, and use of SF characters and Unicode

1 Like

Has anyone used this calculator before… I cannot for the life of me remember how to access the functions UNDER the 2nd row (% , sqr, x2, 1/x etc)… the “S” key is for the UPPER functions,

I even read the official users manual , and if it says, I sure can’t find it

turns out is IS the “S” key, but you have to be in “COMP” mode not (BIN, OCT, DEC or HEX)

I’m under the impression that if you are in “COMP” then pressing the key will do what is under it (for example BLK will do %) without using S.

you are correct. Thanks

basicly the GREEN items are only availbe when COMP mode is OFF, and “S” is pressed first
RED items are only available when COMP mode is on, REGARDLESS of “S” mode

That’s fantastic @DaveS,

Did the 80s ever really end? From my desk in it’s original cover, a HP 17BII Business. A bit of LCD bleed but otherwise fine. Still conjuring financial calculations like it’s 1987. Perfect mix of gold, orange and brown (very classy). I need new batteries!

Kind regards, Andrew

3 Likes

Looks a shit ton better than the default calculator apps we get on all OSes nowadays.

Are you gonna make this available on the Mac also?

1 Like

This app will run on the new M series mac Desktops… if there is enough interest (ie… I make any money, I might make an Intel version)

1 Like

Opinion?
The current CM100 calculator has functions to handle Sexagesimal notation [HMS]. I think this is something that is rarely if ever used (I know I never have). So I am thinking about replacing this function with RGB. to allow entry of 3 values and show the resulting “COLOR” instead

Problem :frowning: The original Casio CM100 was a 32 bit calculator with Double precision of standard math… I had planned on updating to 64bit , but the problem there is when moving from the Base-N mode to the “comp” mode the Base-N value could exceed what a Double can handle (this wasn’t an issue when the limit was only 32bit

So I have two ideas for solutions…

  1. DON’T update to 64bit, stay at 32 (this would solve a few other minor issues)
  2. Have two sets of internals storage, and NEVER move values between modes

Right now if you enter a value in say HEX mode, and press COMP, the value is moved to the standard calculator move as a Double, If you enter a double it is NOT moved back , you have to use DEC mode… confusing… .just a bit :slight_smile:

WELL DARN!

Float80 is available on Intel when the target system supports an 80-bit long double type, and unavailable on Apple silicon.

Why don’t you implement the original feature set first, true to the visuals, and the do modern enhancements?

well… I pretty much have… not to mention the Base-N portion being 32 or 64 bit is a major internal design change

Turns out that Swift has another datatype (Decimal) which is much more precise than (Double)
it has some limitations but I don’t think they will impact this app.

Decimal can hold the max value of a UInt64 exactly

18446744073709551615

while a double flunks at

9999999999999995904
before resorting to SciNot

2 Likes

I thought Swift did not have a native Decimal or big float data type?

I routinely use Decimal in preference to Double in C# also. There are no problems precisely representing numbers like x.33 or x.66 without rounding errors accumulating. At least in the .NET CLR, Decimal isn’t as fast as double but it’s more accurate and I invariably care more about that. In line-of-business apps, especially, where you’re mostly counting pennies, not doing matrix algebra.

Nor did I, and techincally there is no “Big Float” (some versions on some CPU have a Float80, but not for ARM)… DECIMAL type has some limitations, such as casting, but I managed to overcome all of those and now my calculator works with adequate precision to do conversions properly

what is kinda cool is I added this line to the top of my code

typealias myDatatype = Decimal // instead of Double

and used myDatatype thru out the code… this way if there were an issue, I just alter that one line :slight_smile:

and it is NSDecimalNumber

1 Like

Still working on it, but have most of the display and input functions working properly.
Unlike the Casio CM100 that this is based on, this supports 64Bit values, as opposed to only 32Bit

Here is a shot of HEX display mode

and 64bit BINARY mode (it also does Octal, Decimal and basic floating point math)

3 Likes