Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/Basis/Implementation/real64.sml
ViewVC logotype

Diff of /sml/trunk/src/system/Basis/Implementation/real64.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1374, Mon Sep 15 22:17:10 2003 UTC revision 1375, Mon Sep 15 22:44:08 2003 UTC
# Line 28  Line 28 
28              | _ => true              | _ => true
29            (* end case *))            (* end case *))
30    
31        val rbase = 1073741824.0    (* should be taken from CoreIntInf.base *)
32    
33    (* The next three values are computed laboriously, partly to    (* The next three values are computed laboriously, partly to
34     * avoid problems with inaccurate string->float conversions     * avoid problems with inaccurate string->float conversions
35     * in the compiler itself.     * in the compiler itself.
# Line 203  Line 205 
205      fun fromLargeInt(x : IntInf.int) = let      fun fromLargeInt(x : IntInf.int) = let
206          val CoreIntInf.BI { negative, digits } = CoreIntInf.concrete x          val CoreIntInf.BI { negative, digits } = CoreIntInf.concrete x
207          val w2r = fromInt o InlineT.Word31.copyt_int31          val w2r = fromInt o InlineT.Word31.copyt_int31
         val base = w2r CoreIntInf.base  
208          fun calc [] = 0.0          fun calc [] = 0.0
209            | calc (d :: ds) = w2r d + base * calc ds            | calc (d :: ds) = w2r d + rbase * calc ds
210          val m = calc digits          val m = calc digits
211      in      in
212          if negative then ~m else m          if negative then ~m else m
# Line 243  Line 244 
244                         else if isNan x then raise General.Div                         else if isNan x then raise General.Div
245                           else raise General.Overflow                           else raise General.Overflow
246    
     val rbase = 1073741824.0    (* should be taken from CoreIntInf.base *)  
   
247      fun toLargeInt mode x =      fun toLargeInt mode x =
248          if isNan x then raise Domain          if isNan x then raise Domain
249          else if x == posInf orelse x == negInf then raise Overflow          else if x == posInf orelse x == negInf then raise Overflow

Legend:
Removed from v.1374  
changed lines
  Added in v.1375

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