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

Keith Packard keithp@keithp.com
Mon Sep 7 17:31:49 GMT 2020


Jon Turney <jon.turney@dronecode.org.uk> writes:

> 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?

Yes, lgamma(gamma) returns ERANGE for all overflows and poles. tgamma
returns EDOM for negative integers and -INFINITY, but ERANGE for zero or
overflow as per current POSIX specs.

C17 allows some variation in the errors for tgamma, allowing either
domain or pole errors for non-positive integers, which seems
inconsistent with IEEE754 to me.

> There's also a comment about the historical renaming which might be 
> better exposed as a part of 'NOTES'?

Perhaps?

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20200907/97f47e4d/attachment.sig>


More information about the Newlib mailing list