diff --git a/lib/node_modules/@stdlib/ndarray/min-dtype/README.md b/lib/node_modules/@stdlib/ndarray/min-dtype/README.md index cdb8b687ab2c..85a94a3151dd 100644 --- a/lib/node_modules/@stdlib/ndarray/min-dtype/README.md +++ b/lib/node_modules/@stdlib/ndarray/min-dtype/README.md @@ -68,7 +68,7 @@ dt = minDataType( '3' ); ## Notes -- 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. +- 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. diff --git a/lib/node_modules/@stdlib/ndarray/min-dtype/docs/repl.txt b/lib/node_modules/@stdlib/ndarray/min-dtype/docs/repl.txt index 96a18767fb60..aeaf4246a713 100644 --- a/lib/node_modules/@stdlib/ndarray/min-dtype/docs/repl.txt +++ b/lib/node_modules/@stdlib/ndarray/min-dtype/docs/repl.txt @@ -4,7 +4,7 @@ storing a provided scalar value. The function does *not* provide precision guarantees for non-integer-valued - real numbers. In other words, the function returns the smallest possible + numbers. In other words, the function returns the smallest possible floating-point (i.e., inexact) data type for storing numbers having decimals. diff --git a/lib/node_modules/@stdlib/ndarray/min-dtype/lib/main.js b/lib/node_modules/@stdlib/ndarray/min-dtype/lib/main.js index 69134740a1e6..c9fd84461f78 100644 --- a/lib/node_modules/@stdlib/ndarray/min-dtype/lib/main.js +++ b/lib/node_modules/@stdlib/ndarray/min-dtype/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ // MODULES // +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var isInteger = require( '@stdlib/math/base/assert/is-integer' ); var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); var isComplexLike = require( '@stdlib/assert/is-complex-like' ); @@ -84,7 +86,10 @@ function minFloatDataType( value ) { * // returns 'uint8' */ function minDataType( value ) { - if ( typeof value !== 'number' ) { + if ( !isNumber( value ) ) { + if ( isBoolean( value ) ) { + return 'bool'; + } if ( isComplexLike( value ) ) { if ( minFloatDataType( value.re ) === 'float64' || minFloatDataType( value.im ) === 'float64' ) { return 'complex128'; diff --git a/lib/node_modules/@stdlib/ndarray/min-dtype/test/test.js b/lib/node_modules/@stdlib/ndarray/min-dtype/test/test.js index c998dff20ff2..c4db9c07fa37 100644 --- a/lib/node_modules/@stdlib/ndarray/min-dtype/test/test.js +++ b/lib/node_modules/@stdlib/ndarray/min-dtype/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * 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" 'float32', 'generic', 'generic', - 'generic', - 'generic', + 'bool', + 'bool', 'generic', 'complex64', 'complex64',