summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-22 14:44:52 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-22 14:44:52 +0000
commitb64271013b083b247d975dafbc9e402f45057de7 (patch)
tree33e63eee6bd27b86420dc304f7a6bca3361f9a6a
parentbd759f8dd5d70e266c0eae97d7076976cf2fc2a3 (diff)
downloadgausshs-b64271013b083b247d975dafbc9e402f45057de7.tar
gausshs-b64271013b083b247d975dafbc9e402f45057de7.tar.gz
gausshs-b64271013b083b247d975dafbc9e402f45057de7.tar.bz2
gausshs-b64271013b083b247d975dafbc9e402f45057de7.tar.xz
gausshs-b64271013b083b247d975dafbc9e402f45057de7.zip
Alternate form of ±
-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