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

SCM Repository

[diderot] Diff of /trunk/src/compiler/fields/rational.sml
ViewVC logotype

Diff of /trunk/src/compiler/fields/rational.sml

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

revision 465, Thu Oct 28 22:17:34 2010 UTC revision 466, Thu Oct 28 23:00:52 2010 UTC
# Line 61  Line 61 
61     *)     *)
62      datatype rat = R of {num : II.int, denom : II.int}      datatype rat = R of {num : II.int, denom : II.int}
63    
64      fun explode {num, denom} =      fun explode (R{num, denom}) =
65            if (num < 0)            if (num < 0)
66              then {sign = -1, num = ~num, denom = denom}              then {sign = ~1, num = ~num, denom = denom}
67            else if (num = 0)            else if (num = 0)
68              then {sign = 0, num = 0, denom = 0}              then {sign = 0, num = 0, denom = 0}
69              else {sign = 1, num = num, denom = denom}              else {sign = 1, num = num, denom = denom}

Legend:
Removed from v.465  
changed lines
  Added in v.466

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