This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: fmax(+0,-0)
- From: Andreas Jaeger <aj at suse dot de>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 03 Dec 2002 23:00:32 +0100
- Subject: Re: fmax(+0,-0)
- References: <u8u1hvz4js.fsf@gromit.moeb> <3DECFB60.8040707@redhat.com>
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