Skip to content

Commit 7d6413a

Browse files
committed
Auto-generated commit
1 parent e20755a commit 7d6413a

9 files changed

Lines changed: 138 additions & 1 deletion

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,4 @@ jsconfig.json
202202
####################
203203
CLAUDE.md
204204
GEMINI.md
205+
.claude/

‎CHANGELOG.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-08-06)
7+
## Unreleased (2026-08-10)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`7cc4708`](https://github.com/stdlib-js/stdlib/commit/7cc47082117a2d68d704d4d54a49d068da41477b) - add float16 dtype support to `array/one-to` [(#14151)](https://github.com/stdlib-js/stdlib/pull/14151)
1314
- [`b5ff3b6`](https://github.com/stdlib-js/stdlib/commit/b5ff3b66fe639b073761be77dfe1a3b57773d6f6) - add `entries` method to `array/uint64` [(#13888)](https://github.com/stdlib-js/stdlib/pull/13888)
1415
- [`24405b6`](https://github.com/stdlib-js/stdlib/commit/24405b647f170b8737700ebc9d08752bd5cc1ea5) - add `at` method to `array/uint64` [(#13830)](https://github.com/stdlib-js/stdlib/pull/13830)
1516
- [`382f2ca`](https://github.com/stdlib-js/stdlib/commit/382f2ca82ee11fc125f8162d3b5109793fd95994) - add `array/uint64` [(#12562)](https://github.com/stdlib-js/stdlib/pull/12562)
@@ -79,6 +80,7 @@ This release closes the following issue:
7980

8081
<details>
8182

83+
- [`7cc4708`](https://github.com/stdlib-js/stdlib/commit/7cc47082117a2d68d704d4d54a49d068da41477b) - **feat:** add float16 dtype support to `array/one-to` [(#14151)](https://github.com/stdlib-js/stdlib/pull/14151) _(by Gururaj Gurram)_
8284
- [`ad9d109`](https://github.com/stdlib-js/stdlib/commit/ad9d1092d73c1635a10bb0ac4400c92dd50722eb) - **chore:** clean-up [(#13949)](https://github.com/stdlib-js/stdlib/pull/13949) _(by Philipp Burckhardt, Athan Reines)_
8385
- [`1935a5f`](https://github.com/stdlib-js/stdlib/commit/1935a5f7306c6e1f01f3880f4374dfeadf52f371) - **chore:** clean-up [(#13951)](https://github.com/stdlib-js/stdlib/pull/13951) _(by Philipp Burckhardt)_
8486
- [`b5ff3b6`](https://github.com/stdlib-js/stdlib/commit/b5ff3b66fe639b073761be77dfe1a3b57773d6f6) - **feat:** add `entries` method to `array/uint64` [(#13888)](https://github.com/stdlib-js/stdlib/pull/13888) _(by Divit Jain, Athan Reines)_

‎one-to/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The function recognizes the following data types:
6060

6161
- `float64`: double-precision floating-point numbers (IEEE 754)
6262
- `float32`: single-precision floating-point numbers (IEEE 754)
63+
- `float16`: half-precision floating-point numbers (IEEE 754)
6364
- `complex128`: double-precision complex floating-point numbers
6465
- `complex64`: single-precision complex floating-point numbers
6566
- `int32`: 32-bit two's complement signed integers

‎one-to/benchmark/benchmark.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ bench( format( '%s:dtype=%s', pkg, 'float32' ), function benchmark( b ) {
8484
b.end();
8585
});
8686

87+
bench( format( '%s:dtype=%s', pkg, 'float16' ), function benchmark( b ) {
88+
var arr;
89+
var i;
90+
b.tic();
91+
for ( i = 0; i < b.iterations; i++ ) {
92+
arr = oneTo( 0, 'float16' );
93+
if ( arr.length !== 0 ) {
94+
b.fail( 'should have length 0' );
95+
}
96+
}
97+
b.toc();
98+
if ( !isTypedArrayLike( arr ) ) {
99+
b.fail( 'should return a typed array' );
100+
}
101+
b.pass( 'benchmark finished' );
102+
b.end();
103+
});
104+
87105
bench( format( '%s:dtype=%s', pkg, 'complex128' ), function benchmark( b ) {
88106
var arr;
89107
var i;
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var pow = require( '@stdlib/math/base/special/pow' );
25+
var isTypedArray = require( '@stdlib/assert/is-typed-array' );
26+
var format = require( '@stdlib/string/format' );
27+
var pkg = require( './../package.json' ).name;
28+
var oneTo = require( './../lib' );
29+
30+
31+
// FUNCTIONS //
32+
33+
/**
34+
* Creates a benchmark function.
35+
*
36+
* @private
37+
* @param {PositiveInteger} len - array length
38+
* @returns {Function} benchmark function
39+
*/
40+
function createBenchmark( len ) {
41+
return benchmark;
42+
43+
/**
44+
* Benchmark function.
45+
*
46+
* @private
47+
* @param {Benchmark} b - benchmark instance
48+
*/
49+
function benchmark( b ) {
50+
var arr;
51+
var i;
52+
53+
b.tic();
54+
for ( i = 0; i < b.iterations; i++ ) {
55+
arr = oneTo( len, 'float16' );
56+
if ( arr.length !== len ) {
57+
b.fail( 'unexpected length' );
58+
}
59+
}
60+
b.toc();
61+
if ( !isTypedArray( arr ) ) {
62+
b.fail( 'should return a typed array' );
63+
}
64+
b.pass( 'benchmark finished' );
65+
b.end();
66+
}
67+
}
68+
69+
70+
// MAIN //
71+
72+
/**
73+
* Main execution sequence.
74+
*
75+
* @private
76+
*/
77+
function main() {
78+
var len;
79+
var min;
80+
var max;
81+
var f;
82+
var i;
83+
84+
min = 1; // 10^min
85+
max = 6; // 10^max
86+
87+
for ( i = min; i <= max; i++ ) {
88+
len = pow( 10, i );
89+
f = createBenchmark( len );
90+
bench( format( '%s:dtype=float16,len=%d', pkg, len ), f );
91+
}
92+
}
93+
94+
main();

‎one-to/docs/repl.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
- float64: double-precision floating-point numbers (IEEE 754).
99
- float32: single-precision floating-point numbers (IEEE 754).
10+
- float16: half-precision floating-point numbers (IEEE 754).
1011
- complex128: double-precision complex floating-point numbers.
1112
- complex64: single-precision complex floating-point numbers.
1213
- int32: 32-bit two's complement signed integers.

‎one-to/docs/types/test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import oneTo = require( './index' );
2626
oneTo( 10 ); // $ExpectType Float64Array
2727
oneTo( 10, 'float64' ); // $ExpectType Float64Array
2828
oneTo( 10, 'float32' ); // $ExpectType Float32Array
29+
oneTo( 10, 'float16' ); // $ExpectType Float16ArrayFallback
2930
oneTo( 10, 'complex128' ); // $ExpectType Complex128Array
3031
oneTo( 10, 'complex64' ); // $ExpectType Complex64Array
3132
oneTo( 10, 'int32' ); // $ExpectType Int32Array

‎one-to/package.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"matrix",
6464
"float64array",
6565
"float32array",
66+
"float16array",
6667
"int32array",
6768
"uint32array",
6869
"int16array",
@@ -84,6 +85,9 @@
8485
"float",
8586
"single-precision",
8687
"float32",
88+
"half",
89+
"half-precision",
90+
"float16",
8791
"ieee754",
8892
"integer",
8993
"int32",

‎one-to/test/test.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var tape = require( 'tape' );
2424
var Float64Array = require( './../../float64' );
2525
var Float32Array = require( './../../float32' );
26+
var Float16Array = require( './../../float16' );
2627
var Int32Array = require( './../../int32' );
2728
var Uint32Array = require( './../../uint32' );
2829
var Int16Array = require( './../../int16' );
@@ -183,6 +184,20 @@ tape( 'the function returns a filled array (dtype=float32)', function test( t )
183184
t.end();
184185
});
185186

187+
tape( 'the function returns a filled array (dtype=float16)', function test( t ) {
188+
var expected;
189+
var arr;
190+
191+
expected = new Float16Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
192+
193+
arr = oneTo( 5, 'float16' );
194+
t.strictEqual( instanceOf( arr, Float16Array ), true, 'returns expected value' );
195+
t.strictEqual( arr.length, expected.length, 'returns expected value' );
196+
t.deepEqual( arr, expected, 'returns expected value' );
197+
198+
t.end();
199+
});
200+
186201
tape( 'the function returns a filled array (dtype=complex128)', function test( t ) {
187202
var expected;
188203
var arr;

0 commit comments

Comments
 (0)