@lvlte/ulp 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Eric Lavault (https://github.com/lvlte)
3
+ Copyright (c) 2025 Eric Lavault <lvlte.code@gmail.com> (https://github.com/lvlte)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -11,6 +11,10 @@ export declare const FLOAT64_MIN: number;
11
11
  * @returns The ulp of x, or `NaN` if `x` is not a finite number.
12
12
  */
13
13
  export declare function eps(x?: number): number;
14
+ /**
15
+ * @borrows eps as ulp
16
+ */
17
+ export declare const ulp: typeof eps;
14
18
  /**
15
19
  * Exponent of a normalized floating-point number x.
16
20
  *
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FLOAT64_MIN = void 0;
3
+ exports.ulp = exports.FLOAT64_MIN = void 0;
4
4
  exports.eps = eps;
5
5
  exports.exponent = exponent;
6
6
  const modf_1 = require("@lvlte/modf");
@@ -15,6 +15,7 @@ function eps(x = 1) {
15
15
  }
16
16
  return NaN;
17
17
  }
18
+ exports.ulp = eps;
18
19
  function exponent(x) {
19
20
  if (Number.isFinite(x) && x !== 0) {
20
21
  return _exponent(Math.abs(x));
package/dist/index.d.ts CHANGED
@@ -11,6 +11,10 @@ export declare const FLOAT64_MIN: number;
11
11
  * @returns The ulp of x, or `NaN` if `x` is not a finite number.
12
12
  */
13
13
  export declare function eps(x?: number): number;
14
+ /**
15
+ * @borrows eps as ulp
16
+ */
17
+ export declare const ulp: typeof eps;
14
18
  /**
15
19
  * Exponent of a normalized floating-point number x.
16
20
  *
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export function eps(x = 1) {
10
10
  }
11
11
  return NaN;
12
12
  }
13
+ export const ulp = eps;
13
14
  export function exponent(x) {
14
15
  if (Number.isFinite(x) && x !== 0) {
15
16
  return _exponent(Math.abs(x));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvlte/ulp",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Compute the unit in last place of a given IEEE-754 64-bit number",
5
5
  "license": "MIT",
6
6
  "author": "Eric Lavault <lvlte.code@gmail.com>",