Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/src/system/smlnj/init/core-intinf.sml
ViewVC logotype

Diff of /sml/trunk/src/system/smlnj/init/core-intinf.sml

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

revision 1349, Wed Sep 3 22:22:18 2003 UTC revision 1350, Fri Sep 5 21:34:27 2003 UTC
# Line 515  Line 515 
515                end                end
516    
517      fun div' arg = #1 (divMod' arg)      fun div' arg = #1 (divMod' arg)
     fun mod' arg = #2 (divMod' arg)  
518      fun quot' arg = #1 (quotRem' arg)      fun quot' arg = #1 (quotRem' arg)
519      fun rem' arg = #2 (quotRem' arg)  
520        (* For div and mod we special-case a divisor of 2 (common even-odd test) *)
521        fun mod' (BI { digits = [], ... }, _) = zero
522          | mod' (BI { digits = low :: _, ... },
523                  BI { digits = [0w2], negative }) =
524              if InLine.w31eq (InLine.w31andb (low, 0w1), 0w0) then zero
525              else BI { digits = [0w1], negative = negative }
526          | mod' arg = #2 (divMod' arg)
527    
528        fun rem' (BI { digits = [], ... }, _) = zero
529          | rem' (BI { digits = low :: _, negative },
530                  BI { digits = [0w2], ... }) =
531              if InLine.w31eq (InLine.w31andb (low, 0w1), 0w0) then zero
532              else BI { digits = [0w1], negative = negative }
533          | rem' arg = #2 (quotRem' arg)
534    
535      fun natpow (_, 0) = [0w1]      fun natpow (_, 0) = [0w1]
536        | natpow ([], n) = if InLine.i31lt (n, 0) then raise Assembly.Div else []        | natpow ([], n) = if InLine.i31lt (n, 0) then raise Assembly.Div else []

Legend:
Removed from v.1349  
changed lines
  Added in v.1350

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