Skip to content

Commit 1fb451d

Browse files
authored
test: update test case
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 33cd5f1 commit 1fb451d

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • lib/node_modules/@stdlib/constants/float16/sqrt-half/test

lib/node_modules/@stdlib/constants/float16/sqrt-half/test/test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var abs = require( '@stdlib/math/base/special/abs' );
24+
var f16 = require( '@stdlib/number/float64/base/to-float16' );
2525
var sqrt = require( '@stdlib/math/base/special/sqrt' );
2626
var FLOAT16_SQRT_HALF = require( './../lib' );
2727

@@ -39,10 +39,7 @@ tape( 'the exported value is a half-precision floating-point number equal to 0.7
3939
t.end();
4040
});
4141

42-
tape( 'the exported value is close to sqrt(0.5) within float16 precision', function test( t ) {
43-
var expected = sqrt( 0.5 );
44-
var delta = abs( FLOAT16_SQRT_HALF - expected );
45-
var tol = 1.0e-3; // float16 tolerance
46-
t.ok( delta <= tol, 'within tolerance. expected: '+expected+'. actual: '+FLOAT16_SQRT_HALF+'. delta: '+delta+'. tol: '+tol+'.' );
42+
tape( 'the exported value is equal to sqrt(0.5) within half-precision', function test( t ) {
43+
t.strictEqual( FLOAT16_SQRT_HALF, f16( sqrt( 0.5 ) ), 'returns expected value' );
4744
t.end();
4845
});

0 commit comments

Comments
 (0)