Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var tape = require( 'tape' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var lnf = require( '@stdlib/math/base/special/lnf' );
var pow = require( '@stdlib/math/base/special/pow' );
var powf = require( '@stdlib/math/base/special/powf' );
var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var PINF = require( '@stdlib/constants/float32/pinf' );
Expand Down Expand Up @@ -68,11 +68,10 @@ tape( 'the function returns `+infinity` when provided `0`', function test( t ) {
});

tape( 'the function returns `+infinity` for x smaller than or equal to `-2^23`', function test( t ) {
// TODO: Replace with `powf` once available:
var v = absgammalnf( f32( -pow( 2.0, 23 ) ) );
var v = absgammalnf( f32( -powf( 2.0, 23 ) ) );
t.strictEqual( v, PINF, 'returns expected value' );

v = absgammalnf( f32( -pow( 2.0, 24 ) ) );
v = absgammalnf( f32( -powf( 2.0, 24 ) ) );
t.strictEqual( v, PINF, 'returns expected value' );

t.end();
Expand Down Expand Up @@ -130,8 +129,7 @@ tape( 'the function evaluates the natural logarithm of the gamma function for x
var x;
var v;

// TODO: Replace with `powf` once available:
x = f32( pow( 2.0, 27 ) );
x = f32( powf( 2.0, 27 ) );
v = absgammalnf( x );
expected = f32( x * f32( lnf( x ) - f32( 1.0 ) ) );
t.strictEqual( v, expected, 'returns expected value' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var lnf = require( '@stdlib/math/base/special/lnf' );
var pow = require( '@stdlib/math/base/special/pow' );
var powf = require( '@stdlib/math/base/special/powf' );
var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var PINF = require( '@stdlib/constants/float32/pinf' );
Expand Down Expand Up @@ -77,11 +77,10 @@ tape( 'the function returns `+infinity` when provided `0`', opts, function test(
});

tape( 'the function returns `+infinity` for x smaller than or equal to `-2^23`', opts, function test( t ) {
// TODO: Replace with `powf` once available:
var v = absgammalnf( f32( -pow( 2.0, 23 ) ) );
var v = absgammalnf( f32( -powf( 2.0, 23 ) ) );
t.strictEqual( v, PINF, 'returns expected value' );

v = absgammalnf( f32( -pow( 2.0, 24 ) ) );
v = absgammalnf( f32( -powf( 2.0, 24 ) ) );
t.strictEqual( v, PINF, 'returns expected value' );

t.end();
Expand Down Expand Up @@ -139,8 +138,7 @@ tape( 'the function evaluates the natural logarithm of the absolute value of the
var x;
var v;

// TODO: Replace with `powf` once available:
x = f32( pow( 2.0, 27 ) );
x = f32( powf( 2.0, 27 ) );
v = absgammalnf( x );
expected = f32( x * f32( lnf( x ) - f32( 1.0 ) ) );
t.strictEqual( v, expected, 'returns expected value' );
Expand Down