addaptic

Reference Gamma

lz_log_gamma

The natural logarithm of the gamma function, ln Γ(x), for x above nought.

long lz_log_gamma( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );

Correctly rounded, and it reaches arguments whose gamma function would be far past the answer limit: Γ(1000) itself has more than two thousand digits. At or below nought it is refused, kFailed, flagged not-a-number.

Examples

CallAnswerReturns
lz_log_gamma( 10 )12.801827480081469611207717874566706164kNoError
lz_log_gamma( 0.5 )0.572364942924700087071713675676529356kNoError
lz_log_gamma( 1000 )5905.220423209181211826076912361440789849kNoError
lz_log_gamma( −0.5 )not a numberkFailed

Each answer is what Addaptic printed for the call, at 36 places unless a setting is shown.

Returns

kNoError (0) when the answer is written. Otherwise an error code, with the answer flagged infinite or not-a-number; see Errors and flags.

See also

  • lz_gamma The gamma function, Γ(x).
  • lz_factorial The product of the whole numbers from one to the operand, n!.
  • lz_log_e The natural logarithm.