File tree Expand file tree Collapse file tree 4 files changed +12
-29
lines changed
lib/node_modules/@stdlib/constants/float32/sqrt-three
include/stdlib/constants/float64 Expand file tree Collapse file tree 4 files changed +12
-29
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ limitations under the License.
2020
2121# FLOAT32_SQRT3
2222
23- > [ Square root] [ @stdlib/math/base/special/sqrt ] of ` 3 ` as a single-precision floating-point number.
23+ > [ Square root] [ @stdlib/math/base/special/sqrtf ] of ` 3 ` as a single-precision floating-point number.
2424
2525<section class =" usage " >
2626
@@ -32,10 +32,10 @@ var FLOAT32_SQRT3 = require( '@stdlib/constants/float32/sqrt-three' );
3232
3333#### FLOAT32_SQRT3
3434
35- [ Square root] [ @stdlib/math/base/special/sqrt ] of ` 3 ` as a single-precision floating-point number.
35+ [ Square root] [ @stdlib/math/base/special/sqrtf ] of ` 3 ` as a single-precision floating-point number.
3636
3737``` javascript
38- var bool = ( FLOAT32_SQRT3 === 1.7320507764816284 );
38+ var bool = ( FLOAT32_SQRT3 === 1.7320507764816284 );
3939// returns true
4040```
4141
@@ -90,7 +90,7 @@ console.log( FLOAT32_SQRT3 );
9090
9191#### STDLIB_CONSTANT_FLOAT32_SQRT3
9292
93- Macro for the [ square root] [ @stdlib/math/base/special/sqrt ] of ` 3 ` .
93+ Macro for the [ square root] [ @stdlib/math/base/special/sqrtf ] of ` 3 ` .
9494
9595</section >
9696
@@ -128,7 +128,7 @@ Macro for the [square root][@stdlib/math/base/special/sqrt] of `3`.
128128
129129<section class =" links " >
130130
131- [ @stdlib/math/base/special/sqrt ] : https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/sqrt
131+ [ @stdlib/math/base/special/sqrtf ] : https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/sqrtf
132132
133133</section >
134134
Original file line number Diff line number Diff line change 2222/**
2323* Macro for the square root of 3 as a single-precision floating-point number.
2424*/
25- #define STDLIB_CONSTANT_FLOAT32_SQRT3 1.7320507764816284
25+ #define STDLIB_CONSTANT_FLOAT32_SQRT3 1.7320507764816284f
2626
2727#endif // !STDLIB_CONSTANTS_FLOAT32_SQRT_THREE_H
Original file line number Diff line number Diff line change 11{
2- "name" : " @stdlib/constants/float64 /sqrt-three" ,
2+ "name" : " @stdlib/constants/float32 /sqrt-three" ,
33 "version" : " 0.0.0" ,
4- "description" : " Square root of 3." ,
4+ "description" : " Square root of 3 as a single-precision floating-point number ." ,
55 "license" : " Apache-2.0" ,
66 "author" : {
77 "name" : " The Stdlib Authors" ,
6161 " three" ,
6262 " sqrt3" ,
6363 " ieee754" ,
64- " double" ,
65- " dbl" ,
64+ " single" ,
6665 " floating-point" ,
67- " float64 "
66+ " float32 "
6867 ]
6968}
Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var tape = require ( 'tape' ) ;
24- var sqrt = require ( '@stdlib/math/base/special/sqrt ' ) ;
24+ var sqrtf = require ( '@stdlib/math/base/special/sqrtf ' ) ;
2525var float64ToFloat32 = require ( '@stdlib/number/float64/base/to-float32' ) ;
26- var absf = require ( '@stdlib/math/base/special/absf' ) ;
27- var EPS = require ( '@stdlib/constants/float32/eps' ) ;
2826var FLOAT32_SQRT3 = require ( './../lib' ) ;
2927
3028
@@ -37,20 +35,6 @@ tape( 'main export is a number', function test( t ) {
3735} ) ;
3836
3937tape ( 'the exported value is a single-precision floating-point number equal to the square root of 3' , function test ( t ) {
40- t . equal ( FLOAT32_SQRT3 , float64ToFloat32 ( sqrt ( 3 ) ) , 'equals sqrt(3)' ) ;
41- t . end ( ) ;
42- } ) ;
43-
44- tape ( 'export equals `sqrt(3)`' , function test ( t ) {
45- var delta ;
46- var tol ;
47- var v ;
48-
49- v = sqrt ( 3.0 ) ;
50- delta = absf ( float64ToFloat32 ( v - FLOAT32_SQRT3 ) ) ;
51- tol = EPS * FLOAT32_SQRT3 ;
52-
53- t . ok ( delta <= tol , 'equals sqrt(3) within tolerance ' + tol ) ;
54-
38+ t . equal ( FLOAT32_SQRT3 , float64ToFloat32 ( sqrtf ( 3 ) ) , 'equals sqrtf(3)' ) ;
5539 t . end ( ) ;
5640} ) ;
You can’t perform that action at this time.
0 commit comments