HP3000-L Archives

June 1997, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bruce Toback <[log in to unmask]>
Reply To:
Bruce Toback <[log in to unmask]>
Date:
Tue, 17 Jun 1997 10:20:52 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
Michael Anderson ([log in to unmask]) writes:

>I'v been working with HP COBOL for about 9 years and am aware of the
>"000}" negative zero that goes along with Signed ASCII numerics. However
>try telling a UNIX/C++ person what a negative zero is, AHhhh! He'll tell
>ya that a zero is a zero is a zero, and when it's put that way it's hard
>to call it anything else :-) It would be nice if someone could give me
>some insight or a valid reason for using a negative zero instead of a
>positive zero.

A lucid explanation of negative zero accessible even to a C programmer
can be found in D.E. Knuth's _The Art of Computer Programming_ (a.k.a.
"Knuth")  Vol. 2, section 4.1. (He provides an entertaining history there
as well.) Negative-zero can arise in any numerical representation in
which the sign of a number is encoded separately from its magnitude.

-- Bruce


--------------------------------------------------------------------------
Bruce Toback    Tel: (602) 996-8601| My candle burns at both ends;
OPT, Inc.            (800) 858-4507| It will not last the night;
11801 N. Tatum Blvd. Ste. 142      | But ah, my foes, and oh, my friends -
Phoenix AZ 85028                   | It gives a lovely light.
[log in to unmask]                   |     -- Edna St. Vincent Millay

ATOM RSS1 RSS2