Re: math_error.7 draft 3, for review

Michael Kerrisk
2008-07-21T14:43:23Z

On Mon, Jul 21, 2008 at 4:15 PM, Andries E. Brouwer
<Andries.Brouwer-rh8NL+sEX9E@public.gmane.org> wrote:
> On Mon, Jul 21, 2008 at 01:36:52PM +0200, Michael Kerrisk wrote:
>> Hi Andries,
>>
>> Reading the POSIX.1 specs of various functions, I see that sometimes
>> they talk of the return value of a function as being +0, sometimes
>> +-0, and sometimes -0. Does one need to care about this?
>
> Yes.
>
> These are different floating point values, and sometimes the
> difference is important. In cases of total loss of precision
> it is the only bit left. At a branch cut one has a discontinuity
> and for example the imaginary part of clog(0.0) will be 0
> while the imaginary part of clog(-0.0) is pi*I.

Thanks Andries. I will attend to the difference in my updates.

Cheers,

Michael

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html