diff --git a/hsilop.hs b/hsilop.hs index d241f0a..d346229 100644 --- a/hsilop.hs +++ b/hsilop.hs @@ -18,7 +18,7 @@ io f = interact (unlines . map f . filter (not . null) . lines) result :: Either String Double -> String result (Left err) = "Ꞥ∘ " ++ err result (Right x) = printf ("ꟼ∘ " ++ format) x where - format = if ceiling n == floor n then "%.0f" else "%.10f" + format = if ceiling x == floor x then "%.0f" else "%.10f" -- Solve a RPN expression