[project @ 1999-07-29 10:01:05 by simonmar]
authorsimonmar <unknown>
Thu, 29 Jul 1999 10:01:05 +0000 (10:01 +0000)
committersimonmar <unknown>
Thu, 29 Jul 1999 10:01:05 +0000 (10:01 +0000)
Document changes to shift operations.

ghc/docs/libraries/Int.sgml
ghc/docs/libraries/Word.sgml

index 0e29d6c..b26cfe2 100644 (file)
@@ -83,6 +83,14 @@ with arithmetic sequences) also hold for the <tt/Enum/ instances
 over the various <tt/Int/ types defined here.
 
 <item>
+Right and left shifts by amounts greater than or equal to the width of
+the type result in either zero or -1, depending on the sign of the
+value being shifted.  This is contrary to the behaviour in C, which is
+undefined; a common interpretation is to truncate the shift count to
+the width of the type, for example <tt>1 &lt;&lt; 32 == 1</tt> in some
+C implementations.
+
+<item>
 Hugs does not provide <tt/Int64/ at the moment.
 
 </itemize>
index 79af677..bf85825 100644 (file)
@@ -102,6 +102,13 @@ such as <tt/Int/ (see the section of the Haskell report dealing
 with arithmetic sequences) also hold for the <tt/Enum/ instances
 over the various <tt/Word/ types defined here.
 
+<item>
+Right and left shifts by amounts greater than or equal to the width of
+the type result in a zero result.  This is contrary to the behaviour
+in C, which is undefined; a common interpretation is to truncate
+the shift count to the width of the type, for example <tt>1 &lt;&lt;
+32 == 1</tt> in some C implementations.
+
 </itemize>
 
 <bf/Implementation notes:/