aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-utils.stanza
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
-rw-r--r--src/main/stanza/ir-utils.stanza10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 0118c73b..93dc0d79 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -86,9 +86,13 @@ public defn abs (x:Long) -> Long :
if x < to-long(0) : to-long(0) - x
else : x
-;public defn to-int (x:Long) -> Int :
- ;if x > to-long(2147483647) or x < to-long(–2147483648) : error("Long too big to convert to Int")
- ;else : x + 0
+public defn max (x:Long,y:Long) -> Long :
+ if x < y : y
+ else : x
+
+public defn to-int (x:Long) -> Int :
+ if x > to-long(2147483647) or x < to-long(-2147483648) : error("Long too big to convert to Int")
+ else : to-int(to-string(x))
;============== PRINTERS ===================================