summaryrefslogtreecommitdiff
path: root/rpn.hs
diff options
context:
space:
mode:
Diffstat (limited to 'rpn.hs')
-rwxr-xr-x[-rw-r--r--]rpn.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpn.hs b/rpn.hs
index 5c75fcf..dbb0f1f 100644..100755
--- a/rpn.hs
+++ b/rpn.hs
@@ -67,7 +67,7 @@ clarifySymbol s = do
67 67
68isKnownSymbol :: String -> Bool 68isKnownSymbol :: String -> Bool
69isKnownSymbol s = or [ 69isKnownSymbol s = or [
70 s `elem` ["+", "-", "*", "/", "±", "e"], 70 s `elem` ["+", "-", "*", "/", "±", "pm", "e"],
71 isJust $ (maybeRead s :: Maybe Double) 71 isJust $ (maybeRead s :: Maybe Double)
72 ] 72 ]
73 73
@@ -85,6 +85,7 @@ interpreteSymbol "-" = Sub
85interpreteSymbol "*" = Mult 85interpreteSymbol "*" = Mult
86interpreteSymbol "/" = Div 86interpreteSymbol "/" = Div
87interpreteSymbol "±" = Unc 87interpreteSymbol "±" = Unc
88interpreteSymbol "+-" = Unc
88interpreteSymbol "e" = Exp 89interpreteSymbol "e" = Exp
89interpreteSymbol x = Number (read x) 0 90interpreteSymbol x = Number (read x) 0
90 91