diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/README.md b/lib/node_modules/@stdlib/math/base/special/hypotf/README.md index 906d3e561914..facf49747c08 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/README.md @@ -83,20 +83,19 @@ h = hypotf( 5.0, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var hypotf = require( '@stdlib/math/base/special/hypotf' ); -var x; -var y; -var h; -var i; +var len = 100; +var opts = { + 'dtype': 'float32' +}; +var x = discreteUniform( len, -50, 50, opts ); +var y = discreteUniform( len, -50, 50, opts ); -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = hypotf( x, y ); - console.log( 'h(%d,%d) = %d', x, y, h ); +var i; +for ( i = 0; i < len; i++ ) { + console.log( 'h(%d,%d) = %d', x[ i ], y[ i ], hypotf( x[ i ], y[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.js b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.js index dffda0f39e6c..feb4a9a9cf44 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.js @@ -21,7 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var pkg = require( './../package.json' ).name; var hypotf = require( './../lib' ); @@ -37,16 +37,24 @@ var opts = { // MAIN // bench( pkg, function benchmark( b ) { + var opts; + var len; var x; var y; var z; var i; + opts = { + 'dtype': 'float32' + }; + + len = 100; + x = uniform( len, -50, 50, opts ); + y = uniform( len, -50, 50, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = ( randu()*100.0 ) - 50.0; - z = hypotf( x, y ); + z = hypotf( x[ i % len ], y[ i % len ] ); if ( isnanf( z ) ) { b.fail( 'should not return NaN' ); } @@ -60,16 +68,24 @@ bench( pkg, function benchmark( b ) { }); bench( pkg+'::built-in', opts, function benchmark( b ) { + var opts; + var len; var x; var y; var z; var i; + opts = { + 'dtype': 'float32' + }; + + len = 100; + x = uniform( len, -50, 50, opts ); + y = uniform( len, -50, 50, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = ( randu()*100.0 ) - 50.0; - z = Math.hypot( x, y ); // eslint-disable-line stdlib/no-builtin-math + z = Math.hypot( x[ i % len ], y[ i % len ] ); // eslint-disable-line stdlib/no-builtin-math if ( isnanf( z ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.native.js index b0caa25454c4..32aa166d8f34 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/benchmark.native.js @@ -22,7 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -39,16 +39,24 @@ var opts = { // MAIN // bench( pkg+'::native', opts, function benchmark( b ) { + var opts; + var len; var x; var y; var z; var i; + opts = { + 'dtype': 'float32' + }; + + len = 100; + x = uniform( len, -50, 50, opts ); + y = uniform( len, -50, 50, opts ); + b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu()*100.0 ) - 50.0; - y = ( randu()*100.0 ) - 50.0; - z = hypotf( x, y ); + z = hypotf( x[ i % len ], y[ i % len ] ); if ( isnanf( z ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/c/native/benchmark.c b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/c/native/benchmark.c index bd87f27631f2..b5190aa3e6a8 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/c/native/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/benchmark/c/native/benchmark.c @@ -92,16 +92,19 @@ static float rand_float( void ) { static double benchmark( void ) { double elapsed; double t; - float x; - float y; + float x[ 100 ]; + float y[ 100 ]; float z; int i; + for ( i = 0; i < 100; i++ ) { + x[ i ] = ( 100.0f * rand_float() ) - 50.0f; + y[ i ] = ( 100.0f * rand_float() ) - 50.0f; + } + t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 100.0f*rand_float() ) - 50.0f; - y = ( 100.0f*rand_float() ) - 50.0f; - z = stdlib_base_hypotf( x, y ); + z = stdlib_base_hypotf( x[ i % 100 ], y[ i % 100 ] ); if ( z != z ) { printf( "should not return NaN\n" ); break; diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/hypotf/examples/index.js index 62ee757ca55e..31abb3480876 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/examples/index.js +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/examples/index.js @@ -18,18 +18,17 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var hypotf = require( './../lib' ); -var x; -var y; -var h; -var i; +var len = 100; +var opts = { + 'dtype': 'float32' +}; +var x = discreteUniform( len, -50, 50, opts ); +var y = discreteUniform( len, -50, 50, opts ); -for ( i = 0; i < 100; i++ ) { - x = round( randu()*100.0 ) - 50.0; - y = round( randu()*100.0 ) - 50.0; - h = hypotf( x, y ); - console.log( 'h(%d,%d) = %d', x, y, h ); +var i; +for ( i = 0; i < len; i++ ) { + console.log( 'h(%d,%d) = %d', x[ i ], y[ i ], hypotf( x[ i ], y[ i ] ) ); } diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/manifest.json b/lib/node_modules/@stdlib/math/base/special/hypotf/manifest.json index d7b2bc5b8414..a88451e865fa 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/manifest.json +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/manifest.json @@ -1,84 +1,87 @@ { - "options": { - "task": "build" - }, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "task": "build", - "src": [ - "./src/hypotf.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/napi/binary", - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-infinitef", - "@stdlib/math/base/special/sqrtf" - ] - }, - { - "task": "benchmark", - "src": [ - "./src/hypotf.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-infinitef", - "@stdlib/math/base/special/sqrtf" - ] - }, - { - "task": "examples", - "src": [ - "./src/hypotf.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/math/base/assert/is-nanf", - "@stdlib/math/base/assert/is-infinitef", - "@stdlib/math/base/special/sqrtf" - ] - } - ] + "options": { + "task": "build" + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/binary", + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-infinitef", + "@stdlib/math/base/special/sqrtf", + "@stdlib/constants/float32/pinf" + ] + }, + { + "task": "benchmark", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-infinitef", + "@stdlib/math/base/special/sqrtf", + "@stdlib/constants/float32/pinf" + ] + }, + { + "task": "examples", + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nanf", + "@stdlib/math/base/assert/is-infinitef", + "@stdlib/math/base/special/sqrtf", + "@stdlib/constants/float32/pinf" + ] + } + ] } diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/src/hypotf.c b/lib/node_modules/@stdlib/math/base/special/hypotf/src/main.c similarity index 91% rename from lib/node_modules/@stdlib/math/base/special/hypotf/src/hypotf.c rename to lib/node_modules/@stdlib/math/base/special/hypotf/src/main.c index 23820dca5311..c8b34f785e09 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/src/hypotf.c +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/src/main.c @@ -20,7 +20,7 @@ #include "stdlib/math/base/assert/is_nanf.h" #include "stdlib/math/base/assert/is_infinitef.h" #include "stdlib/math/base/special/sqrtf.h" -#include +#include "stdlib/constants/float32/pinf.h" /** * Computes the hypotenuse avoiding overflow and underflow (single-precision). @@ -41,7 +41,7 @@ float stdlib_base_hypotf( const float x, const float y ) { return 0.0f / 0.0f; // NaN } if ( stdlib_base_is_infinitef( x ) || stdlib_base_is_infinitef( y ) ) { - return INFINITY; + return STDLIB_CONSTANT_FLOAT32_PINF; } a = x; b = y; @@ -60,5 +60,5 @@ float stdlib_base_hypotf( const float x, const float y ) { return 0.0f; } b /= a; - return a * stdlib_base_sqrtf( 1.0f + (b*b) ); + return a * stdlib_base_sqrtf( 1.0f + ( b * b ) ); } diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.js b/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.js index 194261e04dda..73ba408de3bf 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.js @@ -26,7 +26,7 @@ var PINF = require( '@stdlib/constants/float32/pinf' ); var NINF = require( '@stdlib/constants/float32/ninf' ); var EPS = require( '@stdlib/constants/float32/eps' ); var absf = require( '@stdlib/math/base/special/absf' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); var pow = require( '@stdlib/math/base/special/pow' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); @@ -50,28 +50,28 @@ tape( 'the function returns `+infinity` if either argument is `+-infinity`', fun var h; h = hypotf( PINF, 3.14 ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( 3.14, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, 3.14 ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( 3.14, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( PINF, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( PINF, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); t.end(); }); @@ -80,13 +80,13 @@ tape( 'the function returns `NaN` if either argument is `NaN`', function test( t var h; h = hypotf( NaN, 3.14 ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); h = hypotf( 3.14, NaN ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); h = hypotf( NaN, NaN ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); t.end(); }); @@ -95,16 +95,16 @@ tape( 'the function returns `+0` if both arguments are `+-0`', function test( t var h; h = hypotf( +0.0, +0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( -0.0, +0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( +0.0, -0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( -0.0, -0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); t.end(); }); @@ -139,13 +139,13 @@ tape( 'the function computes the hypotenuse (canonical inputs)', function test( var h; h = hypotf( 3.0, 4.0 ); - t.strictEqual( h, 5.0, 'returns 5.0' ); + t.strictEqual( h, 5.0, 'returns expected value' ); h = hypotf( 6.0, 8.0 ); - t.strictEqual( h, 10.0, 'returns 10.0' ); + t.strictEqual( h, 10.0, 'returns expected value' ); h = hypotf( 5.0, 12.0 ); - t.strictEqual( h, 13.0, 'returns 13.0' ); + t.strictEqual( h, 13.0, 'returns expected value' ); t.end(); }); @@ -153,7 +153,7 @@ tape( 'the function computes the hypotenuse (canonical inputs)', function test( tape( 'the function avoids overflow', function test( t ) { var h; - h = float64ToFloat32( sqrt( float64ToFloat32( float64ToFloat32( pow( 1.0e38, 2 ) ) + float64ToFloat32( pow( 1.0e38, 2 ) ) ) ) ); // eslint-disable-line max-len + h = sqrtf( float64ToFloat32( float64ToFloat32( pow( 1.0e38, 2 ) ) + float64ToFloat32( pow( 1.0e38, 2 ) ) ) ); // eslint-disable-line max-len t.strictEqual( h, PINF, 'returns +infinity' ); h = hypotf( 1.0e38, 1.0e38 ); @@ -165,7 +165,7 @@ tape( 'the function avoids overflow', function test( t ) { tape( 'the function avoids underflow', function test( t ) { var h; - h = float64ToFloat32( sqrt( float64ToFloat32( float64ToFloat32( pow( 1.0e-45, 2 ) ) + float64ToFloat32( pow( 1.0e-45, 2 ) ) ) ) ); // eslint-disable-line max-len + h = sqrtf( float64ToFloat32( float64ToFloat32( pow( 1.0e-45, 2 ) ) + float64ToFloat32( pow( 1.0e-45, 2 ) ) ) ); // eslint-disable-line max-len t.strictEqual( h, 0.0, 'returns 0' ); h = hypotf( 1.0e-45, 1.0e-45 ); diff --git a/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.native.js b/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.native.js index d6fc91d9c5f5..aa9efd5a15b6 100644 --- a/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.native.js +++ b/lib/node_modules/@stdlib/math/base/special/hypotf/test/test.native.js @@ -27,7 +27,7 @@ var PINF = require( '@stdlib/constants/float32/pinf' ); var NINF = require( '@stdlib/constants/float32/ninf' ); var EPS = require( '@stdlib/constants/float32/eps' ); var absf = require( '@stdlib/math/base/special/absf' ); -var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); var pow = require( '@stdlib/math/base/special/pow' ); var isnanf = require( '@stdlib/math/base/assert/is-nanf' ); var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' ); @@ -59,28 +59,28 @@ tape( 'the function returns `+infinity` if either argument is `+-infinity`', opt var h; h = hypotf( PINF, 3.14 ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( 3.14, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, 3.14 ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( 3.14, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( PINF, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, PINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( PINF, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); h = hypotf( NINF, NINF ); - t.strictEqual( h, PINF, 'returns +infinity' ); + t.strictEqual( h, PINF, 'returns expected value' ); t.end(); }); @@ -89,13 +89,13 @@ tape( 'the function returns `NaN` if either argument is `NaN`', opts, function t var h; h = hypotf( NaN, 3.14 ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); h = hypotf( 3.14, NaN ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); h = hypotf( NaN, NaN ); - t.strictEqual( isnanf( h ), true, 'returns NaN' ); + t.strictEqual( isnanf( h ), true, 'returns expected value' ); t.end(); }); @@ -104,16 +104,16 @@ tape( 'the function returns `+0` if both arguments are `+-0`', opts, function te var h; h = hypotf( +0.0, +0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( -0.0, +0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( +0.0, -0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); h = hypotf( -0.0, -0.0 ); - t.strictEqual( isPositiveZerof( h ), true, 'returns +0' ); + t.strictEqual( isPositiveZerof( h ), true, 'returns expected value' ); t.end(); }); @@ -137,7 +137,7 @@ tape( 'the function computes the hypotenuse', opts, function test( t ) { t.ok( true, 'x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'.' ); } else { delta = absf( h - expected[ i ] ); - tol = 1.4 * EPS * absf( expected[ i ] ); + tol = 2.0 * EPS * absf( expected[ i ] ); t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y[i]+'. h: '+h+'. Expected: '+expected[i]+'. Delta: '+delta+'. Tol: '+tol+'.' ); } } @@ -148,13 +148,13 @@ tape( 'the function computes the hypotenuse (canonical inputs)', opts, function var h; h = hypotf( 3.0, 4.0 ); - t.strictEqual( h, 5.0, 'returns 5.0' ); + t.strictEqual( h, 5.0, 'returns expected value' ); h = hypotf( 6.0, 8.0 ); - t.strictEqual( h, 10.0, 'returns 10.0' ); + t.strictEqual( h, 10.0, 'returns expected value' ); h = hypotf( 5.0, 12.0 ); - t.strictEqual( h, 13.0, 'returns 13.0' ); + t.strictEqual( h, 13.0, 'returns expected value' ); t.end(); }); @@ -162,7 +162,7 @@ tape( 'the function computes the hypotenuse (canonical inputs)', opts, function tape( 'the function avoids overflow', opts, function test( t ) { var h; - h = float64ToFloat32( sqrt( float64ToFloat32( float64ToFloat32( pow( 1.0e38, 2 ) ) + float64ToFloat32( pow( 1.0e38, 2 ) ) ) ) ); // eslint-disable-line max-len + h = sqrtf( float64ToFloat32( float64ToFloat32( pow( 1.0e38, 2 ) ) + float64ToFloat32( pow( 1.0e38, 2 ) ) ) ); // eslint-disable-line max-len t.strictEqual( h, PINF, 'returns +infinity' ); h = hypotf( 1.0e38, 1.0e38 ); @@ -174,7 +174,7 @@ tape( 'the function avoids overflow', opts, function test( t ) { tape( 'the function avoids underflow', opts, function test( t ) { var h; - h = float64ToFloat32( sqrt( float64ToFloat32( float64ToFloat32( pow( 1.0e-45, 2 ) ) + float64ToFloat32( pow( 1.0e-45, 2 ) ) ) ) ); // eslint-disable-line max-len + h = sqrtf( float64ToFloat32( float64ToFloat32( pow( 1.0e-45, 2 ) ) + float64ToFloat32( pow( 1.0e-45, 2 ) ) ) ); // eslint-disable-line max-len t.strictEqual( h, 0.0, 'returns 0' ); h = hypotf( 1.0e-45, 1.0e-45 );