diff options
Diffstat (limited to 'rpn.hs')
| -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 | ||
