This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: "division: function singularity" in libjava/java/lang/e_log.c:107
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: tromey at redhat dot com
- Cc: Christian Joensson <c dot christian dot joensson at telia dot com>,java at gcc dot gnu dot org
- Date: Thu, 31 Jan 2002 12:46:54 +0000 (GMT)
- Subject: Re: "division: function singularity" in libjava/java/lang/e_log.c:107
- References: <20020119233131.GA20982@arnljot.myip.org><87elk7qbo8.fsf@creche.redhat.com>
Tom Tromey writes:
> >>>>> "Christian" == Christian Joensson <c.christian.joensson@telia.com> writes:
>
> Christian> When looking through the testresults in
> Christian> http://gcc.gnu.org/ml/gcc-testresults/2002-02/msg00363.html
> Christian> I see a strange warning "division: function singularity".
>
> I never saw a reply to this.
>
> Christian> ../../../libjava/java/lang/e_log.c: In function `__ieee754_log':
> Christian> ../../../libjava/java/lang/e_log.c:107: warning: division: function singularity
> Christian> Is this a serious warning?
It's this line:
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
In other words, the code is deliberately returning NaN for log of a
negative number. The compiler is complaining about correct code.
Andrew.