🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3929

Re: Type of expression

#3929
From: John Winters
Date: Tue, 05 Sep 1995 18:50
22 lines
1317 bytes
In article <42eu5d$jmq$1@mhafm.production.compuserve.com>,
Edward Diener  <70304.2632@CompuServe.COM> wrote:
>>Thus, if 0x80000000 (2147483648) can be represented correctly as
>>a long int---e.g., on a 64-bit machine where 0x80000000 is 
>>really
>>0x0000000080000000---its type is `long int', otherwise its type
>>is `unsigned long int'.
>
>I should have originally asked whether 0x80000000L was a long int 
>or an unsigned long int on a 32 bit machine ? Your answer tells 
>me that the type is an unsigned long int on a 32 bit machine 
>since the number is too big for a long int, whose maximum size on 
>a 32 bit machine is 0x7FFFFFFF . Thanks for your response.

Surely 0x80000000L is only too big for a long int on a 32 bit machine
if you intend it to be interpreted as a positive number?  It fits in a
32 bit signed int fine, and represents -2147483648.

John

-- 
John Winters.  Wallingford, Oxon, England.
Technical Details
Message-ID: <DEG4C6.6Ao@polo.demon.co.uk>
Path: arc1-ca.pugleaf.net!dispatch.news.demon.net!demon!polo!john
References: <42df0h$73v@elf.bsdi.com> <42eu5d$jmq$1@mhafm.production.compuserve.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!dispatch.news.demon.net!demon!polo!john
From: john@polo.demon.co.uk (John Winters)
Newsgroups: comp.std.c
Subject: Re: Type of expression
Date: Tue, 5 Sep 1995 18:50:29 GMT
Organization: Wallingford
Message-ID: <DEG4C6.6Ao@polo.demon.co.uk>
References: <42df0h$73v@elf.bsdi.com> <42eu5d$jmq$1@mhafm.production.compuserve.com>
X-NNTP-Posting-Host: polo.demon.co.uk