summaryrefslogtreecommitdiff
path: root/Fractran/Interpreter.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-02-07 23:22:16 +1100
committerJed Barber <jjbarber@y7mail.com>2014-02-07 23:22:16 +1100
commit7054599bbf955574fad1ae65cf6ab7eb117cfa17 (patch)
tree4c2e156ac19ff46d427ec4779f58842ea449c6e8 /Fractran/Interpreter.hs
parent862d0b8e2ad71c6cc6268608130167deff08dab7 (diff)
Fixed miscellaneous minor errors
Diffstat (limited to 'Fractran/Interpreter.hs')
-rw-r--r--Fractran/Interpreter.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Fractran/Interpreter.hs b/Fractran/Interpreter.hs
index 0427aed..b62f279 100644
--- a/Fractran/Interpreter.hs
+++ b/Fractran/Interpreter.hs
@@ -19,5 +19,11 @@ fractran program =
then newV : (f prog newV)
else f (tail p) v)
result = map round (f prog (fromIntegral (initialValue program)))
- in value : result
+ in (initialValue program) : result
+
+
+
+isInt :: (RealFrac a) => a -> Bool
+isInt x =
+ x == fromInteger (round x)