need clarification on -0

Ned Deily nad at acm.org
Sun Nov 29 07:33:43 CET 2009


In article <009b4bab$0$26925$c3e8da3 at news.astraweb.com>,
 Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> When it comes to integers, I'm not aware of any mathematical or 
> programming system which treats -0 and +0 as distinct entities, even if 
> they have different internal representations.

A documented feature of most FORTRAN run-time libraries on the Control 
Data 6600/70/170 family (a one's-complement architecture cited earlier 
by Tim Roberts) was to convert a blank numeric input field (i.e. 
consisting of all space characters) to minus zero.   Many programmers 
took advantage of that, using a test for -0 as an easy, though not 100% 
foolproof, test for a missing numeric value.

-- 
 Ned Deily,
 nad at acm.org




More information about the Python-list mailing list