JS Calculator (win10 style)

Hi all,

Sort of completed my calculator today. Will add more functionality, but the basic version is ready. All buttons than can be clicked should work. Any feedback / bugs (have been debugging past hours, but I suppose there will still be some) is greatly appreciated!

Link: https://bengitter.github.io/JavaScriptCalculator/

EDIT: Should the history pane, be accesible on mobile?


Only two bugs so far:

Couldn’t get factorial from 5555555555 (ten digits) - the page hangs.
Only six digits after decimal :unamused: - tried to subtract 0.0000005 and 0.0000002, got zero.

Impressive job so far - usually calculator projects are very fragile.

I’m looking forward to full functionality, to try to break it :wink:

1 Like

Thanks for having a look! Should indeed have a maximum to factorial. The 6 digits was to prevent floating point error, but I suppose a few extra digits should work. Will fix it asap.

EDIT: Fixed it. Too large factorial will simply give an error and you should be able to have 15 digits after the decimal.

simply outstanding!!!

1 Like



How did you it?

) (


(I added 0.0 and last x just because it looks cooler :wink: )

Thanks for the extensive testing! Got a gh-pages build error while fixing it, but should work now.

All buttons should work now. I feel like there will be a lot more bugs, since the length of my code has slightly gotten out of hand (over 650 lines JS).

Anyway, if anyone would try to break it, that would be greatly appreciated :grin:

If you don’t want to scroll up: https://bengitter.github.io/JavaScriptCalculator