From 831507b417f9cf2d7cb873bd59d1324cf0097999 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 18 Dec 2025 02:43:32 +0000 Subject: [PATCH] feat: update `number/float32/base/assert` TypeScript declarations Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../float32/base/assert/docs/types/index.d.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/node_modules/@stdlib/number/float32/base/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/number/float32/base/assert/docs/types/index.d.ts index 8e89fa166f83..9ecbf34fb21e 100644 --- a/lib/node_modules/@stdlib/number/float32/base/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/number/float32/base/assert/docs/types/index.d.ts @@ -21,6 +21,7 @@ /* eslint-disable max-lines */ import isAlmostEqual = require( '@stdlib/number/float32/base/assert/is-almost-equal' ); +import isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); import isSameValue = require( '@stdlib/number/float32/base/assert/is-same-value' ); import isSameValueZero = require( '@stdlib/number/float32/base/assert/is-same-value-zero' ); @@ -67,6 +68,44 @@ interface Namespace { */ isAlmostEqual: typeof isAlmostEqual; + /** + * Tests if two single-precision floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place). + * + * ## Notes + * + * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. + * + * @param a - first input value + * @param b - second input value + * @param maxULP - maximum allowed ULP difference + * @returns boolean indicating whether two single-precision floating-point numbers are approximately the same value within a specified number of ULPs + * + * @example + * var EPS = require( '@stdlib/constants/float32/eps' ); + * + * var bool = ns.isAlmostSameValue( 1.0, 1.0+EPS, 1 ); + * // returns true + * + * bool = ns.isAlmostSameValue( 1.0+EPS, 1.0, 1 ); + * // returns true + * + * bool = ns.isAlmostSameValue( 1.0, 1.0+EPS+EPS, 1 ); + * // returns false + * + * bool = ns.isAlmostSameValue( 1.0, 1.0+EPS, 0 ); + * // returns false + * + * bool = ns.isAlmostSameValue( 0.0, -0.0, 0 ); + * // returns false + * + * bool = ns.isAlmostSameValue( 1.0, NaN, 1 ); + * // returns false + * + * bool = ns.isAlmostSameValue( NaN, NaN, 1 ); + * // returns true + */ + isAlmostSameValue: typeof isAlmostSameValue; + /** * Tests if two single-precision floating-point numbers are the same value. *