🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #11

Re: What is the value of `(unsigned) -1' ??

#11
From: Paul Eggert
Date: Tue, 27 Oct 1992 19:02
7 lines
804 bytes
meissner@osf.org (Michael Meissner) writes:

  In a one's complement 32-bit system, (unsigned)-1 returns 0xfffffffe.
  In a sign/magnitude 32-bit system, (unsigned)-1 returns 0x80000001.

No, ANSI C 3.2.1.2 makes it clear that (unsigned)-1 always yields UINT_MAX,
regardless of how -1 is represented internally.
Technical Details
Message-ID: <bjQHC!?V@twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!usc!ucla-cs!twinsun!eggert
References: <1992Oct27.071744.4871@netcom.com> <MEISSNER.92Oct27121234@tiktok.osf.org>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!usc!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: What is the value of `(unsigned) -1' ??
Message-ID: <bjQHC!?V@twinsun.com>
Sender: usenet@twinsun.com
Nntp-Posting-Host: farside
Organization: Twin Sun, Inc
References: <1992Oct27.071744.4871@netcom.com> <MEISSNER.92Oct27121234@tiktok.osf.org>
Date: Tue, 27 Oct 1992 19:02:55 GMT
Lines: 7