comparison src/prim.sml @ 285:e89076c41c39

toString for float and bool
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 10:20:42 -0400
parents ed4af33681d8
children ffa18975e661
comparison
equal deleted inserted replaced
284:77a28e7430bf 285:e89076c41c39
47 else 47 else
48 Int64.toString n ^ "LL" 48 Int64.toString n ^ "LL"
49 49
50 fun float2s n = 50 fun float2s n =
51 if Real64.compare (n, Real64.fromInt 0) = LESS then 51 if Real64.compare (n, Real64.fromInt 0) = LESS then
52 "-" ^ Real64.toString (Real64.~ n) ^ "L" 52 "-" ^ Real64.toString (Real64.~ n)
53 else 53 else
54 Real64.toString n ^ "L" 54 Real64.toString n
55 55
56 fun p_t_GCC t = 56 fun p_t_GCC t =
57 case t of 57 case t of
58 Int n => string (int2s n) 58 Int n => string (int2s n)
59 | Float n => string (float2s n) 59 | Float n => string (float2s n)