calc82: Devlog #3 10/07/2026
calc82: because calculators are for everyone
Oh dear, looks like I lost 4 hours of counted time in the last devlog… let’s try to make this one a bit shorter!
This devlog follows the implementation of the other inline functions of the calculator:
🌟 New functionality summary
- inverse and hyperbolic trig
- arbitrary roots
- absolute value
- percent
- random numbers: Ran and RanInt
- scientific notation: *10^x / E
- combinatorics: nPr and nCr
- variables (not yet adjustable)
📋 Implementation details
Implementing most of this functionality followed the same general steps:
- identify
- implement
- test.
As I undertook this process. other dependent requirements popped up - such as the implementation of multivariable functions, which in turn required the expansion of the tokeniser and parser.
Also, I implemented degrees, radians, and gradians modes into the calculator, and the associated functions (as postfix expressions - e.g. sin(30d) for degrees).
🗄️ decimal.js changes
Finally, I applied some further changes to decimal.js.:
- Rounding now depends on the closeness of the output to a known value, rather than the input, reducing unnecessary rounding
- Near-decimal values close to 0, 0.25, 0.5, 0.75 and 1 are now caught.
🗒️ Notes:
Remembering that Javascript is weird
NaN === NaN is FALSE! Spent a good 10 minutes figuring this one out. The solution was to use isNaN().
Fixing negative-base powers:
(-8)^(1/3) should equal 2 but returns NaN
Fixed by taking the denominator from the output of a decimal.js toFraction() function, which attempts to create a rational fraction. This overcomes the tiny precision loss and evaluates the function correctly
📈 Next steps
Immediate:
- Add fractional I/O
- Implement polar/rectangualr conversion
Medium:
- Create algebraic display functionality
- Multi-line calculation (Ans) and setting variables
Long-term:
- Build UI
- Ship :)
This has been a bit of a shorter devlog. But I’m still proud of what I achieved! Thanks so much for reading. If you have any suggestions, please leave me a comment. Take care
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.