From 8ad7a88c951b0831e3ab0dd37777562718633df3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 29 Jul 1999 10:01:05 +0000 Subject: [PATCH] [project @ 1999-07-29 10:01:05 by simonmar] Document changes to shift operations. --- ghc/docs/libraries/Int.sgml | 8 ++++++++ ghc/docs/libraries/Word.sgml | 7 +++++++ 2 files changed, 15 insertions(+) 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. +