Re: [PATCH] libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2]

Jon Turney <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On 04/09/2020 17:25, Keith Packard via Newlib wrote:
> The current gamma, gamma_r, gammaf and gammaf_r functions return
> |gamma(x)| instead of ln(|gamma(x)|) due to a change made back in 2002
> to the __ieee754_gamma_r implementation. This patch fixes that, making
> all of these functions map too their lgamma equivalents.
> 
> To fix the underlying bug, the __ieee754_gamma functions have been
> changed to return gamma(x), removing the _r variants as those are no
> longer necessary. Their names have been changed to __ieee754_tgamma to
> avoid potential confusion from users.
> 
> Now that the __ieee754_tgamma functions return the correctly signed
> value, the tgamma functions have been modified to use them.

Does the documentation (embedded in some comments at the start of 
w_gamma.c) for these functions need updating?  I'm not sure if the 
'RETURNS' section is correct now?

There's also a comment about the historical renaming which might be 
better exposed as a part of 'NOTES'?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.