Skip to content

Commit 8e5eb10

Browse files
committed
Auto-generated commit
1 parent bd6e7c4 commit 8e5eb10

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

Diff for: CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,28 @@
251251

252252
<!-- /.package -->
253253

254+
<section class="package" id="ndarray-min-dtype-unreleased">
255+
256+
#### [@stdlib/ndarray/min-dtype](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/min-dtype)
257+
258+
<details>
259+
260+
<section class="features">
261+
262+
##### Features
263+
264+
- [`21052a2`](https://github.com/stdlib-js/stdlib/commit/21052a211289b86b0e8a2e1f43a4d4c5b2379ffb) - add boolean dtype support to `ndarray/min-dtype` [(#2552)](https://github.com/stdlib-js/stdlib/pull/2552)
265+
266+
</section>
267+
268+
<!-- /.features -->
269+
270+
</details>
271+
272+
</section>
273+
274+
<!-- /.package -->
275+
254276
<section class="package" id="ndarray-mostly-safe-casts-unreleased">
255277

256278
#### [@stdlib/ndarray/mostly-safe-casts](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/mostly-safe-casts)
@@ -418,6 +440,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
418440

419441
<details>
420442

443+
- [`21052a2`](https://github.com/stdlib-js/stdlib/commit/21052a211289b86b0e8a2e1f43a4d4c5b2379ffb) - **feat:** add boolean dtype support to `ndarray/min-dtype` [(#2552)](https://github.com/stdlib-js/stdlib/pull/2552) _(by Jaysukh Makvana, Athan Reines)_
421444
- [`efecd32`](https://github.com/stdlib-js/stdlib/commit/efecd32448520402335cdf8fdb34ee88b96556b9) - **feat:** add boolean dtype support to `ndarray/base/buffer-dtype` [(#2572)](https://github.com/stdlib-js/stdlib/pull/2572) _(by Jaysukh Makvana, Athan Reines)_
422445
- [`0f0dbca`](https://github.com/stdlib-js/stdlib/commit/0f0dbcaa7eddb30c09c8cc394224cd4a409b90a6) - **feat:** add boolean dtype support to `ndarray/base/buffer-ctors` [(#2571)](https://github.com/stdlib-js/stdlib/pull/2571) _(by Jaysukh Makvana, Athan Reines)_
423446
- [`1cb0243`](https://github.com/stdlib-js/stdlib/commit/1cb0243d79c25ae193c058bb15ceeebad6cf3cfd) - **feat:** add boolean dtype support to `ndarray/next-dtype` [(#2553)](https://github.com/stdlib-js/stdlib/pull/2553) _(by Jaysukh Makvana)_

Diff for: min-dtype/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dt = minDataType( '3' );
6868

6969
## Notes
7070

71-
- The function does **not** provide precision guarantees for non-integer-valued real numbers. In other words, the function returns the smallest possible floating-point (i.e., inexact) [data type][@stdlib/ndarray/dtypes] for storing numbers having decimals.
71+
- The function does **not** provide precision guarantees for non-integer-valued numbers. In other words, the function returns the smallest possible floating-point (i.e., inexact) [data type][@stdlib/ndarray/dtypes] for storing numbers having decimals.
7272

7373
</section>
7474

Diff for: min-dtype/docs/repl.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
storing a provided scalar value.
55

66
The function does *not* provide precision guarantees for non-integer-valued
7-
real numbers. In other words, the function returns the smallest possible
7+
numbers. In other words, the function returns the smallest possible
88
floating-point (i.e., inexact) data type for storing numbers having
99
decimals.
1010

Diff for: min-dtype/lib/main.js

+7-2
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) 2024 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.
@@ -20,6 +20,8 @@
2020

2121
// MODULES //
2222

23+
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
24+
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
2325
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
2426
var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' );
2527
var isComplexLike = require( '@stdlib/assert/is-complex-like' );
@@ -84,7 +86,10 @@ function minFloatDataType( value ) {
8486
* // returns 'uint8'
8587
*/
8688
function minDataType( value ) {
87-
if ( typeof value !== 'number' ) {
89+
if ( !isNumber( value ) ) {
90+
if ( isBoolean( value ) ) {
91+
return 'bool';
92+
}
8893
if ( isComplexLike( value ) ) {
8994
if ( minFloatDataType( value.re ) === 'float64' || minFloatDataType( value.im ) === 'float64' ) {
9095
return 'complex128';

Diff for: min-dtype/test/test.js

+3-3
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) 2024 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.
@@ -177,8 +177,8 @@ tape( 'the function returns the minimum ndarray data type of the closest "kind"
177177
'float32',
178178
'generic',
179179
'generic',
180-
'generic',
181-
'generic',
180+
'bool',
181+
'bool',
182182
'generic',
183183
'complex64',
184184
'complex64',

0 commit comments

Comments
 (0)