Skip to content

Commit d1d1736

Browse files
committed
test: add tests for IEEE 754-2019 compliance
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 5271c7a commit d1d1736

File tree

12 files changed

+124
-16
lines changed

12 files changed

+124
-16
lines changed

lib/node_modules/@stdlib/math/base/special/cos/test/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,15 @@ tape( 'the function returns `NaN` if provided a `-infinity`', function test( t )
214214
t.equal( isnan( v ), true, 'returns expected value' );
215215
t.end();
216216
});
217+
218+
tape( 'the function returns `1` if provided `+-0`', function test( t ) {
219+
var v;
220+
221+
v = cos( -0.0 );
222+
t.equal( v, 1.0, 'returns expected value' );
223+
224+
v = cos( +0.0 );
225+
t.equal( v, 1.0, 'returns expected value' );
226+
227+
t.end();
228+
});

lib/node_modules/@stdlib/math/base/special/cos/test/test.native.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,15 @@ tape( 'the function returns `NaN` if provided a `-infinity`', opts, function tes
223223
t.equal( isnan( v ), true, 'returns expected value' );
224224
t.end();
225225
});
226+
227+
tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) {
228+
var v;
229+
230+
v = cos( -0.0 );
231+
t.equal( v, 1.0, 'returns expected value' );
232+
233+
v = cos( +0.0 );
234+
t.equal( v, 1.0, 'returns expected value' );
235+
236+
t.end();
237+
});

lib/node_modules/@stdlib/math/base/special/cosh/test/test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ tape( 'the function computes the hyperbolic cosine (large values)', function tes
116116
t.end();
117117
});
118118

119-
tape( 'the function returns `1` if provided `0`', function test( t ) {
120-
var v = cosh( 0 );
119+
tape( 'the function returns `1` if provided `+-0`', function test( t ) {
120+
var v;
121+
122+
v = cosh( -0.0 );
123+
t.equal( v, 1.0, 'returns expected value' );
124+
125+
v = cosh( +0.0 );
121126
t.equal( v, 1.0, 'returns expected value' );
127+
122128
t.end();
123129
});
124130

lib/node_modules/@stdlib/math/base/special/cosh/test/test.native.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,15 @@ tape( 'the function computes the hyperbolic cosine (large values)', opts, functi
125125
t.end();
126126
});
127127

128-
tape( 'the function returns `1` if provided `0`', opts, function test( t ) {
129-
var v = cosh( 0 );
128+
tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) {
129+
var v;
130+
131+
v = cosh( -0.0 );
132+
t.equal( v, 1.0, 'returns expected value' );
133+
134+
v = cosh( +0.0 );
130135
t.equal( v, 1.0, 'returns expected value' );
136+
131137
t.end();
132138
});
133139

lib/node_modules/@stdlib/math/base/special/cospi/test/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) {
6363
t.end();
6464
});
6565

66+
tape( 'the function returns `1` if provided `+-0`', function test( t ) {
67+
var y;
68+
69+
y = cospi( -0.0 );
70+
t.equal( y, 1.0, 'returns expected value' );
71+
72+
y = cospi( +0.0 );
73+
t.equal( y, 1.0, 'returns expected value' );
74+
75+
t.end();
76+
});
77+
6678
tape( 'if provided an integer, the function returns `+-1.0`', function test( t ) {
6779
var expected;
6880
var x;

lib/node_modules/@stdlib/math/base/special/cospi/test/test.native.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ tape( 'if provided `NaN`, the function returns `NaN`', opts, function test( t )
7272
t.end();
7373
});
7474

75+
tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) {
76+
var y;
77+
78+
y = cospi( -0.0 );
79+
t.equal( y, 1.0, 'returns expected value' );
80+
81+
y = cospi( +0.0 );
82+
t.equal( y, 1.0, 'returns expected value' );
83+
84+
t.end();
85+
});
86+
7587
tape( 'if provided an integer, the function returns `+-1.0`', opts, function test( t ) {
7688
var expected;
7789
var x;

lib/node_modules/@stdlib/math/base/special/exp/test/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,15 @@ tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) {
163163
t.equal( isnan( val ), true, 'returns NaN' );
164164
t.end();
165165
});
166+
167+
tape( 'the function returns `1` if provided `+-0`', function test( t ) {
168+
var val;
169+
170+
val = exp( -0.0 );
171+
t.equal( val, 1.0, 'returns expected value' );
172+
173+
val = exp( +0.0 );
174+
t.equal( val, 1.0, 'returns expected value' );
175+
176+
t.end();
177+
});

lib/node_modules/@stdlib/math/base/special/exp/test/test.native.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,15 @@ tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t )
172172
t.equal( isnan( val ), true, 'returns NaN' );
173173
t.end();
174174
});
175+
176+
tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) {
177+
var val;
178+
179+
val = exp( -0.0 );
180+
t.equal( val, 1.0, 'returns expected value' );
181+
182+
val = exp( +0.0 );
183+
t.equal( val, 1.0, 'returns expected value' );
184+
185+
t.end();
186+
});

lib/node_modules/@stdlib/math/base/special/exp10/test/test.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,15 @@ tape( 'the function returns `+infinity` if provided `+infinity`', function test(
170170
t.end();
171171
});
172172

173-
tape( 'the function returns `1` if provided `0`', function test( t ) {
174-
var v = exp10( 0.0 );
175-
t.equal( v, 1.0, 'equals 1' );
173+
tape( 'the function returns `1` if provided `+-0`', function test( t ) {
174+
var val;
175+
176+
val = exp10( -0.0 );
177+
t.equal( val, 1.0, 'returns expected value' );
178+
179+
val = exp10( +0.0 );
180+
t.equal( val, 1.0, 'returns expected value' );
181+
176182
t.end();
177183
});
178184

lib/node_modules/@stdlib/math/base/special/exp10/test/test.native.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,15 @@ tape( 'the function returns `+infinity` if provided `+infinity`', opts, function
179179
t.end();
180180
});
181181

182-
tape( 'the function returns `1` if provided `0`', opts, function test( t ) {
183-
var v = exp10( 0.0 );
184-
t.equal( v, 1.0, 'equals 1' );
182+
tape( 'the function returns `1` if provided `+-0`', opts, function test( t ) {
183+
var val;
184+
185+
val = exp10( -0.0 );
186+
t.equal( val, 1.0, 'returns expected value' );
187+
188+
val = exp10( +0.0 );
189+
t.equal( val, 1.0, 'returns expected value' );
190+
185191
t.end();
186192
});
187193

0 commit comments

Comments
 (0)