Home My Page Projects Code Snippets Project Openings diderot
 Summary Activity Tracker Tasks SCM

# SCM Repository

[diderot] Diff of /trunk/src/compiler/common/float-lit.sml
 [diderot] / trunk / src / compiler / common / float-lit.sml

# Diff of /trunk/src/compiler/common/float-lit.sml

revision 352, Fri Sep 24 07:21:51 2010 UTC revision 353, Fri Sep 24 21:43:11 2010 UTC
# Line 161  Line 161
161
162      fun fromInt 0 = zero false      fun fromInt 0 = zero false
163        | fromInt n = let        | fromInt n = let
164              val (isNeg, n) = if (n < 0) then (true, ~n) else (false, n)
165            fun toDigits (n, d) = if n < 10            fun toDigits (n, d) = if n < 10
166                  then n :: d                  then n :: d
167                  else toDigits(Int.quot(n, 10), Int.rem(n, 10) :: d)                  else toDigits(Int.quot(n, 10), Int.rem(n, 10) :: d)
# Line 170  Line 171
171                    Flt{isNeg = isNeg, digits = digits, exp = List.length digits}                    Flt{isNeg = isNeg, digits = digits, exp = List.length digits}
172                  end                  end
173            in            in
174              cvt (n < 0)              cvt isNeg
175            end            end
176
177      fun toString PosInf = "+inf"      fun toString PosInf = "+inf"

Legend:
 Removed from v.352 changed lines Added in v.353

 root@smlnj-gforge.cs.uchicago.edu ViewVC Help Powered by ViewVC 1.0.0