diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4c4fc48..7eaa5d0a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5775,6 +5775,7 @@ A total of 30 people contributed to this release. Thank you to the following con
+- [`b633157`](https://github.com/stdlib-js/stdlib/commit/b6331572f8cc0dcd92ac1dbeb0aeaabc4d858615) - **docs:** remove comments, set `isNegative` to `uint8_t` in `math/base/special/gammaln` [(#2732)](https://github.com/stdlib-js/stdlib/pull/2732) _(by Gunj Joshi)_ - [`759e667`](https://github.com/stdlib-js/stdlib/commit/759e6676d54a121a5458edbe0f6caa541c465001) - **feat:** add C implementation for `math/base/special/sinc` _(by Gunj Joshi)_ - [`06b8011`](https://github.com/stdlib-js/stdlib/commit/06b80119890e1868578ba4904e9efaa071b27b05) - **feat:** add C implementation for `math/base/special/binomcoef` _(by Gunj Joshi)_ - [`d745814`](https://github.com/stdlib-js/stdlib/commit/d74581415b30604ce6db2b3a2c4f242040eb3e8e) - **feat:** add C implementation for `math/base/special/gammaln` [(#2636)](https://github.com/stdlib-js/stdlib/pull/2636) _(by Gunj Joshi)_ diff --git a/base/special/gammaln/include/stdlib/math/base/special/gammaln.h b/base/special/gammaln/include/stdlib/math/base/special/gammaln.h index 4f013ff4d..c63383772 100644 --- a/base/special/gammaln/include/stdlib/math/base/special/gammaln.h +++ b/base/special/gammaln/include/stdlib/math/base/special/gammaln.h @@ -16,9 +16,6 @@ * limitations under the License. */ -/** -* Header file containing function declarations. -*/ #ifndef STDLIB_MATH_BASE_SPECIAL_GAMMALN_H #define STDLIB_MATH_BASE_SPECIAL_GAMMALN_H diff --git a/base/special/gammaln/src/main.c b/base/special/gammaln/src/main.c index 963808e23..b803025da 100644 --- a/base/special/gammaln/src/main.c +++ b/base/special/gammaln/src/main.c @@ -403,7 +403,7 @@ static double polyval_w( const double x ) { * // returns 0.0 */ double stdlib_base_gammaln( const double x ) { - bool isNegative; + uint8_t isNegative; int32_t flg; double nadj; double xc; @@ -429,10 +429,10 @@ double stdlib_base_gammaln( const double x ) { } xc = x; if ( xc < 0.0 ) { - isNegative = true; + isNegative = 1; xc = -xc; } else { - isNegative = false; + isNegative = 0; } // If |x| < 2**-56, return -ln(|x|) @@ -483,7 +483,7 @@ double stdlib_base_gammaln( const double x ) { flg = 2; } } - switch ( flg ) { // eslint-disable-line default-case + switch ( flg ) { case 0: z = y * y; p1 = A1C + ( z * polyval_a1( z ) ); @@ -513,7 +513,7 @@ double stdlib_base_gammaln( const double x ) { q = RC + ( y * polyval_r( y ) ); r = ( 0.5 * y ) + ( p / q ); z = 1.0; // gammaln(1+s) = ln(s) + gammaln(s) - switch ( flg ) { // eslint-disable-line default-case + switch ( flg ) { case 7: z *= y + 6.0;