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 08:06 AM, Craig Howland wrote:
No to either of the above.  The 0/0 construct is to cause a floating point "invalid" exception, which the functions do not do.  (The divide has to be done at runtime to cause the exception.)  The double divide can be made float by changing it to 0.0F/0.0F.

After double checking the ISO C standard Annex F, I have to agree with you.

However, it looks like there are other places that already make this mistake. wf_log.c for instance calls nan, and the ISO C Annex F says this case should generate an invalid exception too. There may also be other places that are broken in the same way. This is no excuse for me to make it worse though, so I will post a new patch.

Jim


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