Skip to content

Commit 05d801c

Browse files
committed
Auto-generated commit
1 parent e0495db commit 05d801c

6 files changed

Lines changed: 134 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`7816c92`](https://github.com/stdlib-js/stdlib/commit/7816c92b5fac04969200126d7516f89cf056f7ec) - add float16 dtype support to `array/full` [(#14149)](https://github.com/stdlib-js/stdlib/pull/14149)
1314
- [`de466c1`](https://github.com/stdlib-js/stdlib/commit/de466c1c7555e09de12ae363285fffaefedce4ef) - add float16 dtype support to `array/full-like` [(#14150)](https://github.com/stdlib-js/stdlib/pull/14150)
1415
- [`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)
1516
- [`b5ff3b6`](https://github.com/stdlib-js/stdlib/commit/b5ff3b66fe639b073761be77dfe1a3b57773d6f6) - add `entries` method to `array/uint64` [(#13888)](https://github.com/stdlib-js/stdlib/pull/13888)
@@ -81,6 +82,7 @@ This release closes the following issue:
8182

8283
<details>
8384

85+
- [`7816c92`](https://github.com/stdlib-js/stdlib/commit/7816c92b5fac04969200126d7516f89cf056f7ec) - **feat:** add float16 dtype support to `array/full` [(#14149)](https://github.com/stdlib-js/stdlib/pull/14149) _(by Gururaj Gurram)_
8486
- [`de466c1`](https://github.com/stdlib-js/stdlib/commit/de466c1c7555e09de12ae363285fffaefedce4ef) - **feat:** add float16 dtype support to `array/full-like` [(#14150)](https://github.com/stdlib-js/stdlib/pull/14150) _(by Gururaj Gurram)_
8587
- [`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)_
8688
- [`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)_

full/benchmark/benchmark.js

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

89+
bench( format( '%s:dtype=float16', pkg ), function benchmark( b ) {
90+
var arr;
91+
var i;
92+
b.tic();
93+
for ( i = 0; i < b.iterations; i++ ) {
94+
arr = full( 0, 1.0, 'float16' );
95+
if ( arr.length !== 0 ) {
96+
b.fail( 'should have length 0' );
97+
}
98+
}
99+
b.toc();
100+
if ( !isTypedArrayLike( arr ) ) {
101+
b.fail( 'should return a typed array' );
102+
}
103+
b.pass( 'benchmark finished' );
104+
b.end();
105+
});
106+
89107
bench( format( '%s:dtype=bool', pkg ), function benchmark( b ) {
90108
var arr;
91109
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 full = 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 = full( len, 1.0, '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();

full/docs/types/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import full = require( './index' );
2929
full( 10, 1 ); // $ExpectType Float64Array
3030
full( 10, 1, 'float64' ); // $ExpectType Float64Array
3131
full( 10, 1, 'float32' ); // $ExpectType Float32Array
32+
full( 10, 1, 'float16' ); // $ExpectType Float16ArrayFallback
3233
full( 10, z, 'complex128' ); // $ExpectType Complex128Array
3334
full( 10, z, 'complex64' ); // $ExpectType Complex64Array
3435
full( 10, true, 'bool' ); // $ExpectType BooleanArray

full/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",

full/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' );
@@ -187,6 +188,20 @@ tape( 'the function returns a filled array (dtype=float32)', function test( t )
187188
t.end();
188189
});
189190

191+
tape( 'the function returns a filled array (dtype=float16)', function test( t ) {
192+
var expected;
193+
var arr;
194+
195+
expected = new Float16Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
196+
197+
arr = full( 5, 1.0, 'float16' );
198+
t.strictEqual( instanceOf( arr, Float16Array ), true, 'returns expected value' );
199+
t.strictEqual( arr.length, expected.length, 'returns expected value' );
200+
t.deepEqual( arr, expected, 'returns expected value' );
201+
202+
t.end();
203+
});
204+
190205
tape( 'the function returns a filled array (dtype=bool)', function test( t ) {
191206
var expected;
192207
var arr;

0 commit comments

Comments
 (0)