Skip to content

Commit 3641b1a

Browse files
committed
Auto-generated commit
1 parent 80cbf2d commit 3641b1a

File tree

5 files changed

+17
-144
lines changed

5 files changed

+17
-144
lines changed

.github/.keepalive

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

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@stdlib/math-base-assert-is-nan": "^0.1.1",
4949
"@stdlib/math-base-assert-is-negative-zero": "^0.1.1",
5050
"@stdlib/math-base-special-round": "^0.1.1",
51-
"@stdlib/number-float64-base-to-binary-string": "^0.1.0",
51+
"@stdlib/number-float64-base-to-binary-string": "^0.1.1",
5252
"@stdlib/random-base-randu": "^0.1.0",
5353
"@stdlib/utils-keys": "^0.1.0",
5454
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

test/dist/test.js

Lines changed: 4 additions & 141 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,150 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var objectKeys = require( '@stdlib/utils-keys' );
25-
var PINF = require( '@stdlib/constants-float64-pinf' );
26-
var NINF = require( '@stdlib/constants-float64-ninf' );
27-
var isNegativeZero = require( '@stdlib/math-base-assert-is-negative-zero' );
28-
var isnan = require( '@stdlib/math-base-assert-is-nan' );
29-
var toBinaryString = require( '@stdlib/number-float64-base-to-binary-string' );
30-
var fromBinaryString = require( './../../dist' );
31-
32-
33-
// FIXTURES //
34-
35-
var small = require( './../fixtures/julia/bits_1e-200_1e-308.json' );
36-
var medium = require( './../fixtures/julia/bits_-1e3_1e3.json' );
37-
var large = require( './../fixtures/julia/bits_1e200_1e308.json' );
38-
var subnormal = require( './../fixtures/julia/bits_1e-310_5e-324.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 fromBinaryString, '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-
'11111111111111111111111111111111111111111111111111111111111111111',
62-
'111111111111111111111111111111111111111111111111111111111111111'
63-
];
64-
65-
for ( i = 0; i < values.length; i++ ) {
66-
t.throws( badValue( values[i] ), Error, 'throws an error when provided '+values[i] );
67-
}
68-
t.end();
69-
70-
function badValue( value ) {
71-
return function badValue() {
72-
fromBinaryString( value );
73-
};
74-
}
75-
});
76-
77-
tape( 'if provided all zeros, the function returns `+0`', function test( t ) {
78-
t.strictEqual( fromBinaryString( toBinaryString( 0.0 ) ), 0.0, 'returns +0' );
79-
t.end();
80-
});
81-
82-
tape( 'if provided a sign bit of 1 and all zeros, the function returns `-0`', function test( t ) {
83-
var v = fromBinaryString( toBinaryString( -0.0 ) );
84-
t.strictEqual( isNegativeZero( v ), true, 'returns -0' );
85-
t.end();
86-
});
87-
88-
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 ) {
89-
t.strictEqual( fromBinaryString( toBinaryString( PINF ) ), PINF, 'returns +infinity' );
90-
t.end();
91-
});
92-
93-
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 ) {
94-
t.strictEqual( fromBinaryString( toBinaryString( NINF ) ), NINF, 'returns -infinity' );
95-
t.end();
96-
});
97-
98-
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 ) {
99-
var v = fromBinaryString( toBinaryString( NaN ) );
100-
t.strictEqual( isnan( v ), true, 'returns NaN' );
101-
t.end();
102-
});
103-
104-
tape( 'the function creates double-precision floating-point numbers from literal bit representations for small values', function test( t ) {
105-
var keys;
106-
var key;
107-
var val;
108-
var x;
109-
var i;
110-
111-
keys = objectKeys( small );
112-
for ( i = 0; i < keys.length; i++ ) {
113-
key = keys[ i ];
114-
x = fromBinaryString( key );
115-
val = parseFloat( small[ key ] );
116-
t.strictEqual( x, val, 'returns a double equal to ' + val + ' from ' + key );
117-
}
118-
t.end();
119-
});
120-
121-
tape( 'the function creates double-precision floating-point numbers from literal bit representations for medium values', function test( t ) {
122-
var keys;
123-
var key;
124-
var val;
125-
var x;
126-
var i;
127-
128-
keys = objectKeys( medium );
129-
for ( i = 0; i < keys.length; i++ ) {
130-
key = keys[ i ];
131-
x = fromBinaryString( key );
132-
val = parseFloat( medium[ key ] );
133-
t.strictEqual( x, val, 'returns a double equal to ' + val + ' from ' + key );
134-
}
135-
t.end();
136-
});
137-
138-
tape( 'the function creates double-precision floating-point numbers from literal bit representations for large values', function test( t ) {
139-
var keys;
140-
var key;
141-
var val;
142-
var x;
143-
var i;
144-
145-
keys = objectKeys( large );
146-
for ( i = 0; i < keys.length; i++ ) {
147-
key = keys[ i ];
148-
x = fromBinaryString( key );
149-
val = parseFloat( large[ key ] );
150-
t.strictEqual( x, val, 'returns a double equal to ' + val + ' from ' + key );
151-
}
152-
t.end();
153-
});
154-
155-
tape( 'the function creates double-precision floating-point numbers from literal bit representations for subnormal values', function test( t ) {
156-
var keys;
157-
var key;
158-
var val;
159-
var x;
160-
var i;
161-
162-
keys = objectKeys( subnormal );
163-
for ( i = 0; i < keys.length; i++ ) {
164-
key = keys[ i ];
165-
x = fromBinaryString( key );
166-
val = parseFloat( subnormal[ key ] );
167-
t.strictEqual( x, val, 'returns a double equal to ' + val + ' from ' + key );
168-
}
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
16932
t.end();
17033
});

0 commit comments

Comments
 (0)