Re: On writing negative zero - with or without sign
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Mon, 09 Jul 2007 08:49:29 GMT
Janne Blomqvist wrote:
James Giles wrote:
Just my opinion, but I'd recommend that you print the minus sign.
I don't even see a need to have an option to turn it off. It's not
like any old programs could be dependent on the behavior.
The NIST testsuite is, apparently. To which extent that is
representative of real F77 applications, I don't know.
Well, given that it's a test suite, it's dependency is probably
that it was deliberately written to test whether zero has a
negative sign printed with it. My guess is that it has no
further meaning than that.
The standard has already changed once. It used to be required
that an output of entirely zero digits must not have a minus sign.
And now (as of F95 I think) if the internal value is negative (other
than negative zero) the output field must have a minus sign - even
if the only digits actually output are zeros. Headway occurs slowly.
I can't find it quickly, but I think F2003 requires the minus sign if
the implementation is IEEE and the internal value is a negative zero.
As the standard changes, test suites will too. In the meantime
dropping the sign of zero is a numerically unfriendly act. I still
recommend keeping the sign without options to turn it off.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.
- Follow-Ups:
- Re: On writing negative zero - with or without sign
- From: Jerry DeLisle
- Re: On writing negative zero - with or without sign
- References:
- On writing negative zero - with or without sign
- From: Jerry DeLisle
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: Janne Blomqvist
- On writing negative zero - with or without sign
- Prev by Date: Re: matmul trouble
- Next by Date: Re: matmul trouble
- Previous by thread: Re: On writing negative zero - with or without sign
- Next by thread: Re: On writing negative zero - with or without sign
- Index(es):
Relevant Pages
|