diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-22 14:44:52 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-22 14:44:52 +0000 |
commit | b64271013b083b247d975dafbc9e402f45057de7 (patch) | |
tree | 33e63eee6bd27b86420dc304f7a6bca3361f9a6a | |
parent | bd759f8dd5d70e266c0eae97d7076976cf2fc2a3 (diff) | |
download | gausshs-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.hs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -67,7 +67,7 @@ clarifySymbol s = do | |||
67 | 67 | ||
68 | isKnownSymbol :: String -> Bool | 68 | isKnownSymbol :: String -> Bool |
69 | isKnownSymbol s = or [ | 69 | isKnownSymbol 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 | |||
85 | interpreteSymbol "*" = Mult | 85 | interpreteSymbol "*" = Mult |
86 | interpreteSymbol "/" = Div | 86 | interpreteSymbol "/" = Div |
87 | interpreteSymbol "±" = Unc | 87 | interpreteSymbol "±" = Unc |
88 | interpreteSymbol "+-" = Unc | ||
88 | interpreteSymbol "e" = Exp | 89 | interpreteSymbol "e" = Exp |
89 | interpreteSymbol x = Number (read x) 0 | 90 | interpreteSymbol x = Number (read x) 0 |
90 | 91 | ||