fmax(+0,-0)

Andreas Jaeger aj@suse.de
Tue Dec 3 14:00:00 GMT 2002


Ulrich Drepper <drepper@redhat.com> writes:

> Andreas Jaeger wrote:
>> What is the goal of our fmax implementation?  Should it return +0 for
>> fmax(+0,-0)?  I think the current C implementation :
>> [...]
>
> The standard doesn't require anything specific other than NaN handling.
>  Fortunately.  I'm inclined to leave it as is since no rules of math are
> violated.  If you insist on changing something talk to the ISO C (or
> even better: IEC 60559 people) to add something to their standard.

The standard says in a footnote to F9.9:
       314Ideally, fmax would be sensitive to the sign of zero, for
          example  fmax(-0.0,  +0.0)  would  return  +0;   however,
          implementation in software might be impractical.

So, we ignore that and decide to be impractical?  Fine with me, I just
want to be sure since I've seen an implementation that handles this
correctly.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Libc-alpha mailing list