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
 [smlnj] / sml / branches / num64 / system / Basis / Implementation / word8.sml

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

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