model-writtenrun 2516 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dean Rasheed proposed SQL-callable gamma() and lgamma() as broadly useful C99 mathematical functions, with error handling explicitly identified as needing discussion #1.
- Stepan Neretin requested error messages describing valid ranges #4, but Alvaro Herrera considered that a separate project affecting shared overflow reporting #5, and Dean favored overflow errors that alert users when lgamma() would be more appropriate #6.
- Peter Eisentraut questioned special-value checks, inconsistent overflow handling, and lgamma() thread safety #7; Dean responded with statistical and combinatorial use cases and revised the patch to distinguish negative-integer gamma() inputs and genuine lgamma() overflow #8.
- Tom Lane supported the functions' general usefulness, argued that modern libm implementations could be assumed to follow POSIX, and explained that the unused signgam output posed no practical thread-safety concern #9 #10.
- Dean simplified the wrappers to preserve POSIX NaN and infinity results for exceptional inputs and expanded special-case tests #11, then immediately added checks for platforms that fail to set errno and corrected underflow reporting #12.
- Dmitry Koval challenged returning infinity for zero while raising an error for nearby inputs #13; Dean initially defended the mathematical distinction #14, but months later revised both functions to reject zero and negative-integer inputs consistently, also rejecting gamma(-Infinity) #15.
- Alexandra Wang approved and tested the revised patch, compared libm behavior across Ubuntu, macOS, and Windows, and suggested clarifying that lgamma() can report pole errors as ERANGE #16.
- Dean committed #15 as a3b6dfd410 with Alexandra's comment clarification and a catalog-version bump, retaining the existing error categories because distinguishing domain and range failures seemed unnecessary #17.
- After the commit, Marcos Pegoraro reported apparently missing lgamma() documentation #18 and promptly withdrew the report after finding it #19, leaving both functions landed with no outstanding issue in the thread.