iOS Calculator banner

iOS Calculator

4 devlogs
5h 3m 47s

Simple iOS-like calculator.

Demo Repository

Loading README...

Vova

Shipped this project!

Hours: 5.06
Cookies: 🍪 8
Multiplier: 1.54 cookies/hr

Added more mathematical functionality. You can access to them just click R in the left corner. And fix several bugs like floating point mistake and other bugs.

Vova

.3 + .3 = 6 was never fun to see. Turned out the decimal handler was in the wrong order and the regex wasn’t catching numbers without a leading zero. Both fixed now!

Attachment
0
Vova

Big progress🎉!! I’ve fully fixed the layout issues and added scientific buttons. Everything is now working perfectly, and the calculator looks and behaves as intended. Next, I’ll work on implementing the logic for these new buttons.

Attachment
2

Comments

lokmane
lokmane 5 months ago

Hey, i found a bug where decimals dont work if the number is smaller than 1, for example if i entered 0.3+0.3 it would give me 6

Vova
Vova 5 months ago

Oh yeah, I see, already found a problem. Thanks!

Vova

I added screen rotation to my calculator, which switches it into a wider layout similar to the iOS calculator in landscape mode.
In this mode, I’m currently working on adding scientific buttons and designing them to provide more advanced math functionality (like trigonometric operations and powers).

This feature is still a work in progress, but the core layout and rotation logic are already implemented.

(More time I wasted on trying to add another functionality which doesn’t work now :( )

Attachment
0
Vova

Recently, I fixed the “bug” which is not completely a bug, but rather an IEEE-754 behavior of floating-point arithmetic. For example, when you write 9.3 - 9.1, it equals “0.200000000000001”.
Now I checked some combinations, and I don’t see problems.

Attachment
0