From: simonmar Date: Thu, 29 Jul 1999 10:01:05 +0000 (+0000) Subject: [project @ 1999-07-29 10:01:05 by simonmar] X-Git-Tag: Approximately_9120_patches~5934 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=8ad7a88c951b0831e3ab0dd37777562718633df3 [project @ 1999-07-29 10:01:05 by simonmar] Document changes to shift operations. --- diff --git a/ghc/docs/libraries/Int.sgml b/ghc/docs/libraries/Int.sgml index 0e29d6c..b26cfe2 100644 --- a/ghc/docs/libraries/Int.sgml +++ b/ghc/docs/libraries/Int.sgml @@ -83,6 +83,14 @@ with arithmetic sequences) also hold for the +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 1 << 32 == 1 in some +C implementations. + + Hugs does not provide diff --git a/ghc/docs/libraries/Word.sgml b/ghc/docs/libraries/Word.sgml index 79af677..bf85825 100644 --- a/ghc/docs/libraries/Word.sgml +++ b/ghc/docs/libraries/Word.sgml @@ -102,6 +102,13 @@ such as +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 1 << +32 == 1 in some C implementations. +