Functional Calculator

May 2025
HTML
CSS
JavaScript
Live Demo

Source Code: https://github.com/rohanphanse/calculator

Live Demo: https://rohanphanse.github.io/calculator/

Functional Calculator

An intuitive and easy-to-use web calculator with the power of functional programming languages and the terminal!

My goal for this project was to create a web calculator that offered standard calculator functions as well as more powerful features from programming languages through a simple and accessible syntax.

As a challenge to myself, I decided not to use any external libraries. The entire calculator including the parser, evaluation engine, and UI was implemented with a few thousand lines of JavaScript code!

Functional programming features: map, filter, reduce, functions as first-class objects, anonymous functions, type checking, lambda capture, currying, conditional logic

Terminal features: up and down arrow keys move through history, use help on any function or keyword to learn how to use it, syntax highlighting, autocomplete

Additional features: locally save user-defined variables and functions, base and unit conversions, polynomial root solvers, linear algebra, differentiation

Link to demo: https://rohanphanse.github.io/calculator

Built-in constants and functions

demo of built-in functions

Define custom variables and functions

demo of custom variables and functions

Use functional paradigms like lambda capture and currying

demo of lambda capture and currying

Unit conversions, linear algebra, and more!

demo of built-in functions