Skip to content

chore: update test messages in constants/float32 #6773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
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 @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is `-38`', function test( t ) {
t.equal( FLOAT32_MAX_BASE10_EXPONENT_SUBNORMAL, -38, 'equals -38' );
t.equal( FLOAT32_MAX_BASE10_EXPONENT_SUBNORMAL, -38, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var FLOAT32_MAX_BASE10_EXPONENT = require( './../lib' );

Check warning on line 24 in lib/node_modules/@stdlib/constants/float32/max-base10-exponent/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Identifier name 'FLOAT32_MAX_BASE10_EXPONENT' is too long (> 25)


// TESTS //
Expand All @@ -33,6 +33,6 @@
});

tape( 'the exported value is `38`', function test( t ) {
t.equal( FLOAT32_MAX_BASE10_EXPONENT, 38, 'equals 38' );
t.equal( FLOAT32_MAX_BASE10_EXPONENT, 38, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL = require( './../lib' );

Check warning on line 24 in lib/node_modules/@stdlib/constants/float32/max-base2-exponent-subnormal/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Identifier name 'FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL' is too long (> 25)


// TESTS //
Expand All @@ -33,6 +33,6 @@
});

tape( 'the exported value is -127', function test( t ) {
t.equal( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL, -127, 'equals -127' );
t.equal( FLOAT32_MAX_BASE2_EXPONENT_SUBNORMAL, -127, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is 2**24-1', function test( t ) {
t.equal( FLOAT32_MAX_SAFE_INTEGER, pow( 2, 24 )-1, 'returns 2**24-1' );
t.equal( FLOAT32_MAX_SAFE_INTEGER, pow( 2, 24 )-1, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is `-45`', function test( t ) {
t.equal( FLOAT32_MIN_BASE10_EXPONENT_SUBNORMAL, -45, 'equals -45' );
t.equal( FLOAT32_MIN_BASE10_EXPONENT_SUBNORMAL, -45, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var FLOAT32_MIN_BASE10_EXPONENT = require( './../lib' );

Check warning on line 24 in lib/node_modules/@stdlib/constants/float32/min-base10-exponent/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Identifier name 'FLOAT32_MIN_BASE10_EXPONENT' is too long (> 25)


// TESTS //
Expand All @@ -33,6 +33,6 @@
});

tape( 'the exported value is `-37`', function test( t ) {
t.equal( FLOAT32_MIN_BASE10_EXPONENT, -37, 'equals -37' );
t.equal( FLOAT32_MIN_BASE10_EXPONENT, -37, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var tape = require( 'tape' );
var FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL = require( './../lib' );

Check warning on line 24 in lib/node_modules/@stdlib/constants/float32/min-base2-exponent-subnormal/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Identifier name 'FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL' is too long (> 25)


// TESTS //
Expand All @@ -33,6 +33,6 @@
});

tape( 'the exported value is -149', function test( t ) {
t.equal( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL, -149, 'equals -149' );
t.equal( FLOAT32_MIN_BASE2_EXPONENT_SUBNORMAL, -149, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is `-126`', function test( t ) {
t.equal( FLOAT32_MIN_BASE2_EXPONENT, -126, 'equals -126' );
t.equal( FLOAT32_MIN_BASE2_EXPONENT, -126, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is -2**24+1', function test( t ) {
t.equal( FLOAT32_MIN_SAFE_INTEGER, -pow( 2, 24 )+1, 'returns -2**24+1' );
t.equal( FLOAT32_MIN_SAFE_INTEGER, -pow( 2, 24 )+1, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ tape( 'main export is a number', function test( t ) {

tape( 'export is equal to negative infinity', function test( t ) {
// Note: we rely on implicit type promotion. A 32-bit infinity should be promoted to a 64-bit infinity...
t.equal( FLOAT32_NINF, Number.NEGATIVE_INFINITY, 'equals -infinity' );
t.equal( FLOAT32_NINF, Number.NEGATIVE_INFINITY, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is 4', function test( t ) {
t.equal( NUM_BYTES, 4, 'equals 4' );
t.equal( NUM_BYTES, 4, 'returns expected value' );
t.end();
});
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/constants/float32/phi/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'export is a double-precision floating-point number equal to 1.6180340051651', function test( t ) {
t.equal( FLOAT32_PHI, float64ToFloat32( 1.618033988749895 ), 'equals 1.6180340051651' );
t.equal( FLOAT32_PHI, float64ToFloat32( 1.618033988749895 ), 'returns expected value' );
t.end();
});

tape( 'the exported value equals ( 1 + sqrtf( 5 ) ) / 2', function test( t ) {
t.equal( FLOAT32_PHI, float64ToFloat32( float64ToFloat32( 1.0 + sqrtf( 5.0 ) ) / 2.0 ), 'equals ( 1 + sqrtf( 5 ) ) / 2' );
t.equal( FLOAT32_PHI, float64ToFloat32( float64ToFloat32( 1.0 + sqrtf( 5.0 ) ) / 2.0 ), 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'export is a double-precision floating-point number equal to 9.869604110717773', function test( t ) {
t.equal( FLOAT32_PI_SQUARED, 9.869604110717773, 'equals 9.869604110717773' );
t.equal( FLOAT32_PI_SQUARED, 9.869604110717773, 'returns expected value' );
t.end();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ tape( 'main export is a number', function test( t ) {

tape( 'export is equal to positive infinity', function test( t ) {
// Note: we rely on implicit type promotion. A 32-bit infinity should be promoted to a 64-bit infinity...
t.equal( FLOAT32_PINF, Number.POSITIVE_INFINITY, 'equals +infinity' );
t.equal( FLOAT32_PINF, Number.POSITIVE_INFINITY, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is 24', function test( t ) {
t.equal( FLOAT32_PRECISION, 24, 'equals 24' );
t.equal( FLOAT32_PRECISION, 24, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value equals the smallest normal value', function test( t ) {
t.equal( FLOAT32_SMALLEST_NORMAL, pow(2, -126), 'equals 2**-126' );
t.equal( FLOAT32_SMALLEST_NORMAL, pow(2, -126), 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var tape = require( 'tape' );
var pow = require( '@stdlib/math/base/special/pow' );
var FLOAT32_SMALLEST_SUBNORMAL = require( './../lib' );

Check warning on line 25 in lib/node_modules/@stdlib/constants/float32/smallest-subnormal/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Identifier name 'FLOAT32_SMALLEST_SUBNORMAL' is too long (> 25)


// TESTS //
Expand All @@ -34,6 +34,6 @@
});

tape( 'the exported value equals the smallest single-precision floating-point denormalized value', function test( t ) {
t.equal( FLOAT32_SMALLEST_SUBNORMAL, pow(2, -126)*pow(2, -23), 'equals 2**-126 * 2**-23' );
t.equal( FLOAT32_SMALLEST_SUBNORMAL, pow(2, -126)*pow(2, -23), 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ tape( 'main export is a number', function test( t ) {

tape( 'the exported value equals the square root of single-precision floating-point epsilon', function test( t ) {
var expected = float64ToFloat32( sqrt( FLOAT32_EPSILON ) );
t.strictEqual( FLOAT32_SQRT_EPSILON, expected, 'equals sqrt(2**-23)' );
t.strictEqual( FLOAT32_SQRT_EPSILON, expected, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is a single-precision floating-point number equal to `1.2533141374588013`', function test( t ) {
t.equal( FLOAT32_SQRT_HALF_PI, 1.2533141374588013, 'equals 1.2533141374588013' );
t.equal( FLOAT32_SQRT_HALF_PI, 1.2533141374588013, 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is a single-precision floating-point number equal to the square root of 1/2', function test( t ) {
t.equal( FLOAT32_SQRT_HALF, float64ToFloat32( sqrtf( 1/2 ) ), 'equals sqrtf(1/2)' );
t.equal( FLOAT32_SQRT_HALF, float64ToFloat32( sqrtf( 1/2 ) ), 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'export is a single-precision floating-point number equal to 1.272019624710083', function test( t ) {
t.equal( FLOAT32_SQRT_PHI, 1.272019624710083, 'equals 1.272019624710083' );
t.equal( FLOAT32_SQRT_PHI, 1.272019624710083, 'returns expected value' );
t.end();
});

tape( 'the exported value equals sqrtf(φ)', function test( t ) {
t.equal( FLOAT32_SQRT_PHI, sqrtf(PHI), 'equals sqrtf(φ)' );
t.equal( FLOAT32_SQRT_PHI, sqrtf(PHI), 'returns expected value' );
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ tape( 'main export is a number', function test( t ) {
});

tape( 'the exported value is a single-precision floating-point number equal to the square root of 3', function test( t ) {
t.equal( FLOAT32_SQRT3, float64ToFloat32( sqrtf( 3 ) ), 'equals sqrtf(3)' );
t.equal( FLOAT32_SQRT3, float64ToFloat32( sqrtf( 3 ) ), 'returns expected value' );
t.end();
});