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/branches/num64/system/Basis/Implementation/word8.sml
ViewVC logotype

Diff of /sml/branches/num64/system/Basis/Implementation/word8.sml

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

revision 1393, Fri Sep 26 17:00:32 2003 UTC revision 1683, Thu Nov 11 00:12:41 2004 UTC
# Line 47  Line 47 
47      val andb : word * word -> word = W8.andb      val andb : word * word -> word = W8.andb
48      val notb : word -> word = adapt W8.notb      val notb : word -> word = adapt W8.notb
49    
50      val op * : word * word -> word = adapt W8.*      val op * : word * word -> word = op *
51    (* NOTE: waste of time to check for overflow; really should use Word31      val op + : word * word -> word = op +
52     * arithmetic operators; when those get implemented, switch over.      val op - : word * word -> word = op -
53     *)      val op div : word * word -> word = op div
54      val op + : word * word -> word = adapt W8.+      val op mod : word * word -> word = op mod
     val op - : word * word -> word = adapt W8.-  
     val op div : word * word -> word = W8.div  
     fun op mod (a:word, b:word):word = a-(a div b)*b  
55    
56      fun compare (w1, w2) =      fun compare (w1, w2) =
57            if (W8.<(w1, w2)) then LESS            if (W8.<(w1, w2)) then LESS
58            else if (W8.>(w1, w2)) then GREATER            else if (W8.>(w1, w2)) then GREATER
59            else EQUAL            else EQUAL
60      val op > : word * word -> bool = W8.>      val op > : word * word -> bool = op >
61      val op >= : word * word -> bool = W8.>=      val op >= : word * word -> bool = op >=
62      val op < : word * word -> bool = W8.<      val op < : word * word -> bool = op <
63      val op <= : word * word -> bool = W8.<=      val op <= : word * word -> bool = op <=
64    
65      val ~ : word -> word = ~      val ~ : word -> word = ~
66      fun min (w1, w2) = if (w1 < w2) then w1 else w2      val min : word * word -> word = W8.min
67      fun max (w1, w2) = if (w1 > w2) then w1 else w2      val max : word * word -> word = W8.max
68    
69      fun fmt radix = (NumFormat.fmtWord radix) o toLargeWord      fun fmt radix = (NumFormat.fmtWord radix) o toLargeWord
70      val toString = fmt StringCvt.HEX      val toString = fmt StringCvt.HEX

Legend:
Removed from v.1393  
changed lines
  Added in v.1683

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