diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 10:08:22 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-01-01 10:08:22 -0500 |
commit | 04b18b668cdc26f640cfed063ae9fe845201036b (patch) | |
tree | 29c1a18a15edea62d79e1761e3c63cfc14644d2b /src/prim.sml | |
parent | 0db3fba5d2b9b5c0dbd8468a76b2ef75ebe40437 (diff) |
Source containing an int
Diffstat (limited to 'src/prim.sml')
-rw-r--r-- | src/prim.sml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/prim.sml b/src/prim.sml index 468b28d5..95df6e02 100644 --- a/src/prim.sml +++ b/src/prim.sml @@ -47,6 +47,12 @@ fun int2s n = else Int64.toString n ^ "LL" +fun int2s' n = + if Int64.compare (n, Int64.fromInt 0) = LESS then + "-" ^ Int64.toString (Int64.~ n) + else + Int64.toString n + fun float2s n = if Real64.compare (n, Real64.fromInt 0) = LESS then "-" ^ Real64.toString (Real64.~ n) @@ -55,7 +61,7 @@ fun float2s n = fun toString t = case t of - Int n => int2s n + Int n => int2s' n | Float n => float2s n | String s => s |