This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't do double divide in powf.


On 12/12/2017 05:04 AM, Corinna Vinschen wrote:
On Dec 11 19:45, Jim Wilson wrote:
-		        exc.retval = 0.0/0.0;	/* X/Open allow NaN */
+		        exc.retval = nan("");	/* X/Open allow NaN */

As far as I can see, that still pulls in an unnecessary function call,
nan().

What about using NAN?  That's basically __builtin_nanf("") and usually
resolves without function call on any platform.

I don't see any place in the math dir that currently uses NAN like this, but there are multiple places calling nan(""), so I did it that way. I don't care which way it is done. But it looks like Craig Howland has a legitimate objection, so I will try float 0.0/0.0 divide instead.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]