Re: On writing negative zero - with or without sign



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
.



Relevant Pages

  • Re: On writing negative zero - with or without sign
    ... always fit in 3 spaces on an unprotected field on a display, I don't want the minus sign causing an unnecessary overflow because of insufficient space. ... Support the Original G95 Project: http://www.g95.org ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.fortran)
  • RomFS: enless loop during make oldconfig from 2.6.24 -> 2.6.31-rc4 (parisc)
    ... # IPVS transport protocol load balancing support ... # DCCP Kernel Hacking ... # Device Drivers ... # Display device support ...
    (Linux-Kernel)
  • RE: Save Child GridView only when parent GridView Saved
    ... the page will display multiple Questions and each of which ... I suggest you use Repeater + GridViewbecause ... Since you said that the answer list of each question support ... DataList/GridView control, we need to update the certain anwser record's ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: universelle programmierbare Heizungssteuerung gesucht
    ...Display modes ... Passive color mode supports a total of 16777216 colors ... Support for LCD panels with an internal frame buffer ... Base plane with software control of two overlay windows and a hardware cursor ...
    (de.sci.electronics)
  • Re: How does the system detect the usre action?
    ... The system uses a display idle timer and a system idle timer. ... SetThreadExecutionState with ES_SYSTEM_REQUIRED, the system enters sleep. ... Microsoft Online Community Support ...
    (microsoft.public.win32.programmer.kernel)