Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: all bits zero? Message-ID: <12393@smoke.BRL.MIL> Date: 21 Mar 90 22:39:41 GMT References: <2108@gmdzi.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <2108@gmdzi.UUCP> wittig@gmdzi.UUCP (Georg Wittig) writes: >Does ANSI C require that in the internal representation of the integer constant >``0'' all bits are zero? A "pure binary numeration system" is required for the representation of integral types (that term is defined in the American National Dictionary for Information Processing Systems), so that, other than possibly the sign bit, all bits used to represent the value 0 must be 0. >What about ``0x0'' (hex.) or ``0000'' (oct.)? 0x0==0 && 0000==0 They're not distinct types, just different ways of writing the value 0 in source code. >If it IS allowed that in the internal representation not all bits are >zero, is it then possible to write a #if expression that tests if all >bits of the integer constant ``0'' are zero? No, because the preprocessor is not required to use the same representation as in the run-time environment.