The calculator supports the following feature:
- Linear combination (
+
,-
) - Multiplication and division (
*
,/
) - Local binding (
id = exp
) - Square root operation (
sqrt
) - List all local bindings (
list
) - Clear all or specific local bindings (
clear id
;clear
) - Unary minus operators (
-(a + b)
) - Error message (such as undefined local variables, unclosed parenthese, etc.)
- Exit command (
exit
;quit
)
> ruby calc.rb