Re: On writing negative zero - with or without sign
- From: Gary Scott <garylscott@xxxxxxxxxxxxx>
- Date: Sat, 21 Jul 2007 21:15:29 -0500
James Giles wrote:
Gary Scott wrote:
James Giles wrote:
...
Then print ABS(X). That certainly deals with any sign you might
get. (It might also eliminate a useful sanity check on your data
too.) Besides, I'm absolutely sure that negative zero will fit in an
F3.1 field. You won't get three asterisks, you'll get (-.0).
Then I'd be forced to write to a character variable and manipulate it
to get a proper display.
Not if you used ABS(). But, what about it is improper?
Looks normal to me. There's nothing illicit (or even a
little naughty) about it. No rebellion against settled
authority. No violation of any religious precept (unless
it's some numerological dogma). What's improper?
The values will still read back in correctly - even in
non-Fortran languages.
For example, what if my specification for how the display is to appear (defined by some nebulous system designer somewhere) requires specifically that the display value be displayed as 0.0 through 9.9? I don't have a choice in how I display the value, I'm to implement as the system designer said it should be implemented. If there is a reason to detect negative zero, I can do that separately and pop up a message box that says some sort of unexpected error happened, perhaps a DMA peripheral device set a bit it wasn't supposed to. Or it may be a don't care for this particular application that the sign bit isn't set.
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
If you want to do the impossible, don't hire an expert because he knows it can't be done.
-- Henry Ford
.
- Follow-Ups:
- Re: On writing negative zero - with or without sign
- From: James Giles
- 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: tholen
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: tholen
- Re: On writing negative zero - with or without sign
- From: Gordon Sande
- Re: On writing negative zero - with or without sign
- From: tholen
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: tholen
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: tholen
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: tholen
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: Gary Scott
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: Gary Scott
- Re: On writing negative zero - with or without sign
- From: James Giles
- Re: On writing negative zero - with or without sign
- From: Gary Scott
- Re: On writing negative zero - with or without sign
- From: James Giles
- On writing negative zero - with or without sign
- Prev by Date: Re: On writing negative zero - with or without sign
- Next by Date: Re: On writing negative zero - with or without sign
- 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
|