🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4779

Re: WriteInt(-32768, n)

#4779
From: Robert Firth
Date: Fri, 21 Apr 1989 13:09
21 lines
1120 bytes
In article <503@trwrc.UUCP> agnew@trwrc.UUCP (Robert A. Agnew) writes:

>	I cannot think of any computation that produces 0x8000 without
>causing an overflow (carry into sign bit # carry out of sign bit) short
>of getting it from a 16 bit A/D converter where it's usually considered
>BOGUS.

Well, how about this computation:

	-32767 - 1 => -32768

	(#8001 - #0001 => #8000)

such as would occur, for instance, in 

	i := 0;
	WHILE i # -32768 DO i := i-1 END;

A language or lanugage implementation that arbitrarily excludes one
of the legal values of the underlying machine domain is being pretty
stupid, especially a systems programming language.
Technical Details
Message-ID: <3212@bd.sei.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!pt.cs.cmu.edu!sei!firth
References: <1007@psueea.UUCP> <1029@gmdzi.UUCP> <503@trwrc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!pt.cs.cmu.edu!sei!firth
From: firth@sei.cmu.edu (Robert Firth)
Newsgroups: comp.lang.modula2
Subject: Re: WriteInt(-32768, n)
Message-ID: <3212@bd.sei.cmu.edu>
Date: 21 Apr 89 13:09:06 GMT
References: <1007@psueea.UUCP> <1029@gmdzi.UUCP> <503@trwrc.UUCP>
Reply-To: firth@sei.cmu.edu (Robert Firth)
Organization: Software Engineering Institute, Pittsburgh, PA
Lines: 21