|
From: | Daniel J Sebald |
Subject: | Re: imag () function detail regarding -0.0000 |
Date: | Wed, 12 Sep 2012 19:35:51 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 09/12/2012 04:21 PM, Dmitri A. Sergatskov wrote:
Daniel J Sebald<address@hidden> wrote:So, Octave appears to be fairly adherent to the IEEE 754 standard. I can get used to having the -0 floating about, but it is kind of annoying in arithmetic operations seeing this as I really only think of +/-0 related to convergence.I do not believe Octave does anything special wrt IEEE 754 beyond what underlying C++ compiler/library does. That came up few times and the conclusion was that it is not Octave's business to fix compiler bugs/missing features.
I see that's the case. I just tried some things with a minimal main(){} program.
GCC compliance with IEEE 754 is iffy at the moment. The result may even change with different optimization level.
The gcc man page says that isn't affected by optimization level, i.e., -O1, -O2, etc. There are optimization flags that affect this however, and some that ensure full compliance. For example, there is
-fno-signed-zeroswhich means that the compiled code will produce no signed zeros. The compiler will then optimize out a few small things that it generally shouldn't. (That's not something for a program like Octave.) Can't really change fprintf() easily either, as that is inside a library.
The elegant solution (three zeros) doesn't fall under gcc or Octave. Dan
[Prev in Thread] | Current Thread | [Next in Thread] |