🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2142

Re: should abs() be 'uint'?

#2142
From: Henry Spencer
Date: Sun, 27 Sep 1992 02:51
10 lines
875 bytes
In article <eyal.717552134@ise> eyal@echo.canberra.edu.au (Eyal Lebedinsky) writes:
>If the function was 'unsigned int' then the result would ALWAYS fit into
>the return type...

It would make sense.  Unfortunately, that's not the way abs() was defined
originally... and changing it now might break a lot of code.  One of
X3J11's main guidelines was "do not break legal, working, portable code".
-- 
There is nothing wrong with making      | Henry Spencer @ U of Toronto Zoology
mistakes, but... make *new* ones. -D.Sim|  henry@zoo.toronto.edu  utzoo!henry
Technical Details
Message-ID: <Bv7uL7.2IK@zoo.toronto.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!utzoo!henry
References: <eyal.717552134@ise>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: should abs() be 'uint'?
Message-ID: <Bv7uL7.2IK@zoo.toronto.edu>
Date: Sun, 27 Sep 1992 02:51:05 GMT
References: <eyal.717552134@ise>
Organization: U of Toronto Zoology
Lines: 10