Skip to content

Commit c2e9fcb

Browse files
committed
chore: clean-up
1 parent 5d5044e commit c2e9fcb

File tree

8 files changed

+41
-49
lines changed

8 files changed

+41
-49
lines changed

lib/node_modules/@stdlib/math/base/special/heavisidef/README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# Heaviside Function
2222

23-
> Evaluate the [Heaviside function][heaviside-function] for a single-precision floating-point numeric value.
23+
> Evaluate the [Heaviside function][heaviside-function] for a single-precision floating-point number.
2424
2525
<section class="intro">
2626

@@ -98,7 +98,7 @@ var heavisidef = require( '@stdlib/math/base/special/heavisidef' );
9898

9999
#### heavisidef( x\[, continuity] )
100100

101-
Evaluates the [Heaviside function][heaviside-function] for a single-precision floating-point numeric value.
101+
Evaluates the [Heaviside function][heaviside-function] for a single-precision floating-point number.
102102

103103
```javascript
104104
var v = heavisidef( 3.14 );
@@ -167,12 +167,6 @@ for ( i = 0; i < x.length; i++ ) {
167167

168168
<section class="related">
169169

170-
* * *
171-
172-
## See Also
173-
174-
- <span class="package-name">[`@stdlib/math/base/special/ramp`][@stdlib/math/base/special/ramp]</span><span class="delimiter">: </span><span class="description">evaluate the ramp function.</span>
175-
176170
</section>
177171

178172
<!-- /.related -->
@@ -183,12 +177,6 @@ for ( i = 0; i < x.length; i++ ) {
183177

184178
[heaviside-function]: https://en.wikipedia.org/wiki/Heaviside_step_function
185179

186-
<!-- <related-links> -->
187-
188-
[@stdlib/math/base/special/ramp]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/ramp
189-
190-
<!-- </related-links> -->
191-
192180
</section>
193181

194182
<!-- /.links -->

lib/node_modules/@stdlib/math/base/special/heavisidef/benchmark/benchmark.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
25-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2626
var pkg = require( './../package.json' ).name;
2727
var heavisidef = require( './../lib' );
2828

@@ -34,7 +34,8 @@ bench( pkg, function benchmark( b ) {
3434
var y;
3535
var i;
3636

37-
x = randu( 100, -50.0, 50.0 );
37+
x = uniform( 100, -50.0, 50.0 );
38+
3839
b.tic();
3940
for ( i = 0; i < b.iterations; i++ ) {
4041
y = heavisidef( x[ i % x.length ] );
@@ -55,16 +56,17 @@ bench( pkg+'::left-continuous', function benchmark( b ) {
5556
var y;
5657
var i;
5758

58-
x = randu( 100, -50.0, 50.0 );
59+
x = uniform( 100, -50.0, 50.0 );
60+
5961
b.tic();
6062
for ( i = 0; i < b.iterations; i++ ) {
6163
y = heavisidef( x[ i % x.length ], 'left-continuous' );
62-
if ( isnan( y ) ) {
64+
if ( isnanf( y ) ) {
6365
b.fail( 'should not return NaN' );
6466
}
6567
}
6668
b.toc();
67-
if ( isnan( y ) ) {
69+
if ( isnanf( y ) ) {
6870
b.fail( 'should not return NaN' );
6971
}
7072
b.pass( 'benchmark finished' );
@@ -76,16 +78,17 @@ bench( pkg+'::right-continuous', function benchmark( b ) {
7678
var y;
7779
var i;
7880

79-
x = randu( 100, -50.0, 50.0 );
81+
x = uniform( 100, -50.0, 50.0 );
82+
8083
b.tic();
8184
for ( i = 0; i < b.iterations; i++ ) {
8285
y = heavisidef( x[ i % x.length ], 'right-continuous' );
83-
if ( isnan( y ) ) {
86+
if ( isnanf( y ) ) {
8487
b.fail( 'should not return NaN' );
8588
}
8689
}
8790
b.toc();
88-
if ( isnan( y ) ) {
91+
if ( isnanf( y ) ) {
8992
b.fail( 'should not return NaN' );
9093
}
9194
b.pass( 'benchmark finished' );
@@ -97,16 +100,17 @@ bench( pkg+'::half-maximum', function benchmark( b ) {
97100
var y;
98101
var i;
99102

100-
x = randu( 100, -50.0, 50.0 );
103+
x = uniform( 100, -50.0, 50.0 );
104+
101105
b.tic();
102106
for ( i = 0; i < b.iterations; i++ ) {
103107
y = heavisidef( x[ i % x.length ], 'half-maximum' );
104-
if ( isnan( y ) ) {
108+
if ( isnanf( y ) ) {
105109
b.fail( 'should not return NaN' );
106110
}
107111
}
108112
b.toc();
109-
if ( isnan( y ) ) {
113+
if ( isnanf( y ) ) {
110114
b.fail( 'should not return NaN' );
111115
}
112116
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/math/base/special/heavisidef/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{{alias}}( x[, continuity] )
3-
Evaluates the Heaviside function for a
4-
single-precision floating-point numeric value.
3+
Evaluates the Heaviside function for a single-precision floating-point
4+
number.
55

66
The `continuity` parameter may be one of the following:
77

lib/node_modules/@stdlib/math/base/special/heavisidef/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// TypeScript Version: 4.1
2020

2121
/**
22-
* Evaluates the Heaviside function for a single-precision floating-point numeric value.
22+
* Evaluates the Heaviside function for a single-precision floating-point number.
2323
*
2424
* ## Notes
2525
*

lib/node_modules/@stdlib/math/base/special/heavisidef/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Evaluate the Heaviside function for a single-precision floating-point numeric value.
22+
* Evaluate the Heaviside function for a single-precision floating-point number.
2323
*
2424
* @module @stdlib/math/base/special/heavisidef
2525
*

lib/node_modules/@stdlib/math/base/special/heavisidef/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
// MODULES //
2222

23-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
23+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2424

2525

2626
// MAIN //
2727

2828
/**
29-
* Evaluates the Heaviside function for a single-precision floating-point numeric value.
29+
* Evaluates the Heaviside function for a single-precision floating-point number.
3030
*
3131
* @param {number} x - input value
3232
* @param {string} [continuity] - continuity option
@@ -61,7 +61,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
6161
* // returns NaN
6262
*/
6363
function heavisidef( x, continuity ) {
64-
if ( isnan( x ) ) {
64+
if ( isnanf( x ) ) {
6565
return NaN;
6666
}
6767
if ( x > 0.0 ) {

lib/node_modules/@stdlib/math/base/special/heavisidef/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/math/base/special/heavisidef",
33
"version": "0.0.0",
4-
"description": "Evaluate the Heaviside function for a single-precision floating-point numeric value.",
4+
"description": "Evaluate the Heaviside function for a single-precision floating-point number.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

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

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

2323
var tape = require( 'tape' );
24-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25-
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
24+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
25+
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
2626
var PINF = require( '@stdlib/constants/float32/pinf' );
2727
var NINF = require( '@stdlib/constants/float32/ninf' );
2828
var EPS = require( '@stdlib/constants/float32/eps' );
@@ -46,7 +46,7 @@ tape( 'the function returns `0` if `x` is negative', function test( t ) {
4646
for ( i = 0; i < 1e3; i++ ) {
4747
x = -( randu()*100.0 ) - EPS;
4848
v = heavisidef( x );
49-
t.equal( isPositiveZero( v ), true, 'returns 0 when provided '+x );
49+
t.equal( isPositiveZerof( v ), true, 'returns expected value when provided '+x );
5050
}
5151
t.end();
5252
});
@@ -59,7 +59,7 @@ tape( 'the function returns `1` if `x` is positive', function test( t ) {
5959
for ( i = 0; i < 1e3; i++ ) {
6060
x = ( randu()*100.0 ) + EPS;
6161
v = heavisidef( x );
62-
t.equal( v, 1.0, 'returns 1 when provided '+x );
62+
t.equal( v, 1.0, 'returns expected value when provided '+x );
6363
}
6464
t.end();
6565
});
@@ -68,10 +68,10 @@ tape( 'by default, the function returns `NaN` if provided `+-0`', function test(
6868
var v;
6969

7070
v = heavisidef( -0.0 );
71-
t.equal( isnan( v ), true, 'returns NaN' );
71+
t.equal( isnanf( v ), true, 'returns expected value' );
7272

7373
v = heavisidef( +0.0 );
74-
t.equal( isnan( v ), true, 'returns NaN' );
74+
t.equal( isnanf( v ), true, 'returns expected value' );
7575

7676
t.end();
7777
});
@@ -80,10 +80,10 @@ tape( 'if the `continuity` option is `half-maximum`, the function returns `0.5`
8080
var v;
8181

8282
v = heavisidef( -0.0, 'half-maximum' );
83-
t.equal( v, 0.5, 'returns 1/2' );
83+
t.equal( v, 0.5, 'returns expected value' );
8484

8585
v = heavisidef( +0.0, 'half-maximum' );
86-
t.equal( v, 0.5, 'returns 1/2' );
86+
t.equal( v, 0.5, 'returns expected value' );
8787

8888
t.end();
8989
});
@@ -92,10 +92,10 @@ tape( 'if the `continuity` option is `left-continuous`, the function returns `0.
9292
var v;
9393

9494
v = heavisidef( -0.0, 'left-continuous' );
95-
t.equal( isPositiveZero( v ), true, 'returns 0' );
95+
t.equal( isPositiveZerof( v ), true, 'returns expected value' );
9696

9797
v = heavisidef( +0.0, 'left-continuous' );
98-
t.equal( isPositiveZero( v ), true, 'returns 0' );
98+
t.equal( isPositiveZerof( v ), true, 'returns expected value' );
9999

100100
t.end();
101101
});
@@ -104,28 +104,28 @@ tape( 'if the `continuity` option is `right-continuous`, the function returns `1
104104
var v;
105105

106106
v = heavisidef( -0.0, 'right-continuous' );
107-
t.equal( v, 1, 'returns 1' );
107+
t.equal( v, 1.0, 'returns expected value' );
108108

109109
v = heavisidef( +0.0, 'right-continuous' );
110-
t.equal( v, 1, 'returns 1' );
110+
t.equal( v, 1.0, 'returns expected value' );
111111

112112
t.end();
113113
});
114114

115115
tape( 'the function returns `NaN` if provided `NaN`', function test( t ) {
116116
var v = heavisidef( NaN );
117-
t.equal( isnan( v ), true, 'returns NaN' );
117+
t.equal( isnanf( v ), true, 'returns expected value' );
118118
t.end();
119119
});
120120

121121
tape( 'the function returns `0` if provided `-infinity`', function test( t ) {
122122
var v = heavisidef( NINF );
123-
t.equal( v, 0.0, 'returns 0' );
123+
t.equal( v, 0.0, 'returns expected value' );
124124
t.end();
125125
});
126126

127127
tape( 'the function returns `+1` if provided `+infinity`', function test( t ) {
128128
var v = heavisidef( PINF );
129-
t.equal( v, 1.0, 'returns 1' );
129+
t.equal( v, 1.0, 'returns expected value' );
130130
t.end();
131131
});

0 commit comments

Comments
 (0)