Skip to content

chore: update test messages in constants/float16 #6774

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 @@ -36,6 +36,6 @@ tape( 'main export is a number', function test( t ) {

tape( 'the exported value equals the cube root of half-precision floating-point epsilon', function test( t ) {
var expected = cbrt( FLOAT16_EPSILON );
t.strictEqual( FLOAT16_CBRT_EPSILON, expected, 'equals cbrt(2**-10)' );
t.strictEqual( FLOAT16_CBRT_EPSILON, expected, '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 equals the difference between one and the smallest value greater than one which is representable as a half-precision floating-point number (2**-10)', function test( t ) {
var expected = pow( 2.0, -10 );
t.strictEqual( FLOAT16_EPSILON, expected, 'equals 2**-10' );
t.strictEqual( FLOAT16_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 `15`', function test( t ) {
t.equal( FLOAT16_EXPONENT_BIAS, 15, 'equals 15' );
t.equal( FLOAT16_EXPONENT_BIAS, 15, '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**11-1', function test( t ) {
t.equal( FLOAT16_MAX_SAFE_INTEGER, pow( 2.0, 11 ) - 1.0, 'returns 2**11-1' );
t.equal( FLOAT16_MAX_SAFE_INTEGER, pow( 2.0, 11 ) - 1.0, '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( 'export is equal to the maximum half-precision floating-point number', function test( t ) {
t.equal( FLOAT16_MAX, pow(2, 15) * (2-pow(2, -10)), 'equals max value' );
t.equal( FLOAT16_MAX, pow(2, 15) * (2-pow(2, -10)), '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**11+1', function test( t ) {
t.equal( FLOAT16_MIN_SAFE_INTEGER, -pow( 2.0, 11 )+1, 'returns -2**11+1' );
t.equal( FLOAT16_MIN_SAFE_INTEGER, -pow( 2.0, 11 )+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 16-bit infinity should be promoted to a 64-bit infinity...
t.equal( FLOAT16_NINF, Number.NEGATIVE_INFINITY, 'equals -infinity' );
t.equal( FLOAT16_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 2', function test( t ) {
t.equal( NUM_BYTES, 2, 'equals 2' );
t.equal( NUM_BYTES, 2, '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 positive infinity', function test( t ) {
// Note: we rely on implicit type promotion. A 16-bit infinity should be promoted to a 64-bit infinity...
t.equal( FLOAT16_PINF, Number.POSITIVE_INFINITY, 'equals infinity' );
t.equal( FLOAT16_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 11 (10 significand bits + 1 implicit bit)', function test( t ) {
t.equal( PRECISION, 11, 'equals 11' );
t.equal( PRECISION, 11, '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( FLOAT16_SMALLEST_NORMAL, pow( 2.0, -14 ), 'equals 2**-14' );
t.equal( FLOAT16_SMALLEST_NORMAL, pow( 2.0, -14 ), '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 FLOAT16_SMALLEST_SUBNORMAL = require( './../lib' );

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

View workflow job for this annotation

GitHub Actions / Lint Changed Files

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


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

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

tape( 'the exported value equals the square root of half-precision floating-point epsilon', function test( t ) {
var expected = sqrt( FLOAT16_EPSILON );
t.strictEqual( FLOAT16_SQRT_EPSILON, expected, 'equals sqrt(2**-10)' );
t.strictEqual( FLOAT16_SQRT_EPSILON, expected, 'returns expected value' );
t.end();
});