Preferences

recursive descent parser, normally any decent developer can do that, my version: https://caub.github.io/misc/calculator

"-2 ** 3 SyntaxError: unparenthesized unary expression can't appear on the left-hand side of '*' "

That's actually a great error, I have made the mistake of expecting "-2 ** 2" would output 4 instead of -4 before.

^ fyi, this comment reveals you didn't RTFA
Correct, but my goal was just to get the same result than JS `eval()`except for -n * m because in my opinion this shouln't require parenthesis. It's still a good learn to do this, I don't want to deal with floating points things etc..

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal