Skip to content

Commit 8c6ef00

Browse files
committed
Auto-generated commit
1 parent e4f843c commit 8c6ef00

5 files changed

Lines changed: 20 additions & 138 deletions

File tree

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T04:04:57.750Z

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ jobs:
182182
fi
183183
# Trim leading and trailing whitespace:
184184
dep=$(echo "$dep" | xargs)
185-
version="^$(npm view $dep version)"
185+
version="$(npm view $dep version)"
186+
if [[ -z "$version" ]]; then
187+
continue
188+
fi
189+
version="^$version"
186190
jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp
187191
mv package.json.tmp package.json
188192
done
@@ -192,7 +196,11 @@ jobs:
192196
fi
193197
# Trim leading and trailing whitespace:
194198
dep=$(echo "$dep" | xargs)
195-
version="^$(npm view $dep version)"
199+
version="$(npm view $dep version)"
200+
if [[ -z "$version" ]]; then
201+
continue
202+
fi
203+
version="^$version"
196204
jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp
197205
mv package.json.tmp package.json
198206
done

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <steff456@hotmail.com>
3737
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
3838
orimiles5 <97595296+orimiles5@users.noreply.github.com>
3939
rei2hu <reimu@reimu.ws>
40+
Robert Gislason <gztown2216@yahoo.com>

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
},
3939
"dependencies": {
4040
"@stdlib/constants-float32-exponent-bias": "^0.1.1",
41-
"@stdlib/constants-float32-ninf": "^0.1.0",
42-
"@stdlib/constants-float32-pinf": "^0.1.0",
41+
"@stdlib/constants-float32-ninf": "^0.1.1",
42+
"@stdlib/constants-float32-pinf": "^0.1.1",
4343
"@stdlib/math-base-special-pow": "^0.1.0",
44-
"@stdlib/number-float64-base-to-float32": "^0.1.0",
44+
"@stdlib/number-float64-base-to-float32": "^0.1.1",
4545
"@stdlib/string-format": "^0.1.1"
4646
},
4747
"devDependencies": {
@@ -50,7 +50,7 @@
5050
"@stdlib/math-base-assert-is-negative-zero": "^0.1.1",
5151
"@stdlib/math-base-assert-is-positive-zero": "^0.1.1",
5252
"@stdlib/math-base-special-round": "^0.1.1",
53-
"@stdlib/number-float32-base-to-binary-string": "^0.1.0",
53+
"@stdlib/number-float32-base-to-binary-string": "^0.1.1",
5454
"@stdlib/random-base-randu": "^0.1.0",
5555
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5656
"istanbul": "^0.4.1",

test/dist/test.js

Lines changed: 4 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,141 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var PINF = require( '@stdlib/constants-float32-pinf' );
25-
var NINF = require( '@stdlib/constants-float32-ninf' );
26-
var isNegativeZero = require( '@stdlib/math-base-assert-is-negative-zero' );
27-
var isPositiveZero = require( '@stdlib/math-base-assert-is-positive-zero' );
28-
var isnan = require( '@stdlib/math-base-assert-is-nan' );
29-
var toBinaryStringf = require( '@stdlib/number-float32-base-to-binary-string' );
30-
var fromBinaryStringf = require( './../../dist' );
31-
32-
33-
// FIXTURES //
34-
35-
var small = require( './../fixtures/julia/bits_1e-36_1e-38.json' );
36-
var medium = require( './../fixtures/julia/bits_-1e3_1e3.json' );
37-
var large = require( './../fixtures/julia/bits_1e36_1e38.json' );
38-
var subnormal = require( './../fixtures/julia/bits_1e-39_1e-45.json' );
24+
var main = require( './../../dist' );
3925

4026

4127
// TESTS //
4228

43-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
4430
t.ok( true, __filename );
45-
t.strictEqual( typeof fromBinaryStringf, 'function', 'main export is a function' );
46-
t.end();
47-
});
48-
49-
tape( 'if provided a string with a length other than `32`, the function throws an error', function test( t ) {
50-
var values;
51-
var i;
52-
53-
values = [
54-
'beep',
55-
'1010101',
56-
'',
57-
'101',
58-
'111111111',
59-
'1111111111111111111111111111111',
60-
'111111111111111111111111111111111'
61-
];
62-
63-
for ( i = 0; i < values.length; i++ ) {
64-
t.throws( badValue( values[i] ), Error, 'throws an error when provided '+values[i] );
65-
}
66-
t.end();
67-
68-
function badValue( value ) {
69-
return function badValue() {
70-
fromBinaryStringf( value );
71-
};
72-
}
73-
});
74-
75-
tape( 'if provided all zeros, the function returns `+0`', function test( t ) {
76-
var v = fromBinaryStringf( toBinaryStringf( 0.0 ) );
77-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
78-
t.end();
79-
});
80-
81-
tape( 'if provided a sign bit of 1 and all zeros, the function returns `-0`', function test( t ) {
82-
var v = fromBinaryStringf( toBinaryStringf( -0.0 ) );
83-
t.strictEqual( isNegativeZero( v ), true, 'returns -0' );
84-
t.end();
85-
});
86-
87-
tape( 'if provided a bit sequence where all exponent bits are 1s and everything else is 0, the function returns positive infinity', function test( t ) {
88-
t.strictEqual( fromBinaryStringf( toBinaryStringf( PINF ) ), PINF, 'returns +infinity' );
89-
t.end();
90-
});
91-
92-
tape( 'if provided a bit sequence where the sign bit is 1, all exponent bits are 1s, and everything else is 0, the function returns negative infinity', function test( t ) {
93-
t.strictEqual( fromBinaryStringf( toBinaryStringf( NINF ) ), NINF, 'returns -infinity' );
94-
t.end();
95-
});
96-
97-
tape( 'if provided a bit sequence where the sign bit may be either 1 or 0, all exponent bits are 1s, and the fraction is not all 0s, the function returns `NaN`', function test( t ) {
98-
var v = fromBinaryStringf( toBinaryStringf( NaN ) );
99-
t.strictEqual( isnan( v ), true, 'returns NaN' );
100-
t.end();
101-
});
102-
103-
tape( 'the function creates single-precision floating-point numbers from literal bit representations for small values', function test( t ) {
104-
var expected;
105-
var val;
106-
var x;
107-
var i;
108-
109-
x = small.x;
110-
expected = small.expected;
111-
for ( i = 0; i < x.length; i++ ) {
112-
val = fromBinaryStringf( x[ i ] );
113-
t.strictEqual( val, expected[ i ], 'returns a float equal to ' + expected[ i ] + ' from ' + x[ i ] );
114-
}
115-
t.end();
116-
});
117-
118-
tape( 'the function creates single-precision floating-point numbers from literal bit representations for medium values', function test( t ) {
119-
var expected;
120-
var val;
121-
var x;
122-
var i;
123-
124-
x = medium.x;
125-
expected = medium.expected;
126-
for ( i = 0; i < x.length; i++ ) {
127-
val = fromBinaryStringf( x[ i ] );
128-
t.strictEqual( val, expected[ i ], 'returns a float equal to ' + expected[ i ] + ' from ' + x[ i ] );
129-
}
130-
t.end();
131-
});
132-
133-
tape( 'the function creates single-precision floating-point numbers from literal bit representations for large values', function test( t ) {
134-
var expected;
135-
var val;
136-
var x;
137-
var i;
138-
139-
x = large.x;
140-
expected = large.expected;
141-
for ( i = 0; i < x.length; i++ ) {
142-
val = fromBinaryStringf( x[ i ] );
143-
t.strictEqual( val, expected[ i ], 'returns a float equal to ' + expected[ i ] + ' from ' + x[ i ] );
144-
}
145-
t.end();
146-
});
147-
148-
tape( 'the function creates single-precision floating-point numbers from literal bit representations for subnormal values', function test( t ) {
149-
var expected;
150-
var val;
151-
var x;
152-
var i;
153-
154-
x = subnormal.x;
155-
expected = subnormal.expected;
156-
for ( i = 0; i < x.length; i++ ) {
157-
val = fromBinaryStringf( x[ i ] );
158-
t.strictEqual( val, expected[ i ], 'returns a float equal to ' + expected[ i ] + ' from ' + x[ i ] );
159-
}
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
16032
t.end();
16133
});

0 commit comments

Comments
 (0)