@danielsimonjr/mathts-core 0.17.0 → 0.18.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/dist/{chunk-YS7US6LQ.js → chunk-UEBMU6EV.js} +331 -82
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/internal.js +1 -1
- package/dist/types/unit/Unit.d.ts.map +1 -1
- package/dist/types/unit/exact-scale.d.ts +69 -15
- package/dist/types/unit/exact-scale.d.ts.map +1 -1
- package/dist/types/unit/index.d.ts +2 -2
- package/dist/types/unit/index.d.ts.map +1 -1
- package/dist/types/unit/unit-types.d.ts +6 -0
- package/dist/types/unit/unit-types.d.ts.map +1 -1
- package/dist/types/unit.d.ts +2 -2
- package/dist/types/unit.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2149,23 +2149,81 @@ var DimensionMismatchError = class extends Error {
|
|
|
2149
2149
|
};
|
|
2150
2150
|
|
|
2151
2151
|
// src/types/unit/exact-scale.ts
|
|
2152
|
+
var NAMED_IRRATIONALS = Object.freeze({
|
|
2153
|
+
pi: "3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647",
|
|
2154
|
+
ln2: "0.693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481020570685733"
|
|
2155
|
+
});
|
|
2156
|
+
function isIrrationalName(name2) {
|
|
2157
|
+
return Object.prototype.hasOwnProperty.call(NAMED_IRRATIONALS, name2);
|
|
2158
|
+
}
|
|
2159
|
+
function irrationalPower(s, name2) {
|
|
2160
|
+
return s.irrationals[name2] ?? 0;
|
|
2161
|
+
}
|
|
2162
|
+
function isRationalScale(s) {
|
|
2163
|
+
return Object.keys(s.irrationals).length === 0;
|
|
2164
|
+
}
|
|
2165
|
+
var NO_IRRATIONALS = Object.freeze({});
|
|
2166
|
+
function combinePowers(a, b, sign2) {
|
|
2167
|
+
if (Object.keys(b).length === 0) return a;
|
|
2168
|
+
const out = {};
|
|
2169
|
+
let any = false;
|
|
2170
|
+
for (const name2 of Object.keys(NAMED_IRRATIONALS)) {
|
|
2171
|
+
const k = (a[name2] ?? 0) + sign2 * (b[name2] ?? 0);
|
|
2172
|
+
if (k !== 0) {
|
|
2173
|
+
out[name2] = k;
|
|
2174
|
+
any = true;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
return any ? Object.freeze(out) : NO_IRRATIONALS;
|
|
2178
|
+
}
|
|
2179
|
+
function scalePowers(a, n) {
|
|
2180
|
+
if (n === 0) return NO_IRRATIONALS;
|
|
2181
|
+
if (n === 1 || Object.keys(a).length === 0) return a;
|
|
2182
|
+
const out = {};
|
|
2183
|
+
for (const name2 of Object.keys(a)) out[name2] = a[name2] * n;
|
|
2184
|
+
return Object.freeze(out);
|
|
2185
|
+
}
|
|
2186
|
+
function powersEqual(a, b) {
|
|
2187
|
+
for (const name2 of Object.keys(NAMED_IRRATIONALS)) {
|
|
2188
|
+
if ((a[name2] ?? 0) !== (b[name2] ?? 0)) return false;
|
|
2189
|
+
}
|
|
2190
|
+
return true;
|
|
2191
|
+
}
|
|
2192
|
+
var SAFE_GCD = 1n << 53n;
|
|
2152
2193
|
function gcd(a, b) {
|
|
2153
2194
|
let x = a < 0n ? -a : a;
|
|
2154
2195
|
let y = b < 0n ? -b : b;
|
|
2196
|
+
if (x <= SAFE_GCD && y <= SAFE_GCD) {
|
|
2197
|
+
let p = Number(x);
|
|
2198
|
+
let q = Number(y);
|
|
2199
|
+
while (q !== 0) [p, q] = [q, p % q];
|
|
2200
|
+
return BigInt(p);
|
|
2201
|
+
}
|
|
2155
2202
|
while (y !== 0n) [x, y] = [y, x % y];
|
|
2156
2203
|
return x;
|
|
2157
2204
|
}
|
|
2158
|
-
function
|
|
2205
|
+
function isOne(s) {
|
|
2206
|
+
return s.num === 1n && s.den === 1n && isRationalScale(s);
|
|
2207
|
+
}
|
|
2208
|
+
function make(num, den, irrationals) {
|
|
2159
2209
|
if (den === 0n) throw new RangeError("exact scale: zero denominator");
|
|
2160
2210
|
if (den < 0n) {
|
|
2161
2211
|
num = -num;
|
|
2162
2212
|
den = -den;
|
|
2163
2213
|
}
|
|
2164
2214
|
const g = gcd(num, den);
|
|
2165
|
-
return g > 1n ? { num: num / g, den: den / g,
|
|
2215
|
+
return g > 1n ? { num: num / g, den: den / g, irrationals } : { num, den, irrationals };
|
|
2216
|
+
}
|
|
2217
|
+
var UNIT_EXACT_SCALE = Object.freeze({
|
|
2218
|
+
num: 1n,
|
|
2219
|
+
den: 1n,
|
|
2220
|
+
irrationals: NO_IRRATIONALS
|
|
2221
|
+
});
|
|
2222
|
+
function namedIrrationalScale(name2) {
|
|
2223
|
+
return Object.freeze({ num: 1n, den: 1n, irrationals: Object.freeze({ [name2]: 1 }) });
|
|
2166
2224
|
}
|
|
2167
|
-
var
|
|
2168
|
-
var
|
|
2225
|
+
var PI_EXACT_SCALE = namedIrrationalScale("pi");
|
|
2226
|
+
var LN2_EXACT_SCALE = namedIrrationalScale("ln2");
|
|
2169
2227
|
var DECIMAL = /^([+-]?)(\d*)(?:\.(\d*))?(?:[eE]([+-]?\d+))?$/;
|
|
2170
2228
|
function decimalExactScale(text) {
|
|
2171
2229
|
const m = DECIMAL.exec(text.trim());
|
|
@@ -2177,15 +2235,16 @@ function decimalExactScale(text) {
|
|
|
2177
2235
|
if (!Number.isSafeInteger(exponent) || Math.abs(exponent) > 1e4) return null;
|
|
2178
2236
|
let num = BigInt(whole + fraction);
|
|
2179
2237
|
if (m[1] === "-") num = -num;
|
|
2180
|
-
return exponent >= 0 ? make(num * 10n ** BigInt(exponent), 1n,
|
|
2238
|
+
return exponent >= 0 ? make(num * 10n ** BigInt(exponent), 1n, NO_IRRATIONALS) : make(num, 10n ** BigInt(-exponent), NO_IRRATIONALS);
|
|
2181
2239
|
}
|
|
2182
2240
|
function exactScaleOf(x) {
|
|
2183
2241
|
if (!Number.isFinite(x)) throw new RangeError(`exact scale: ${x} is not finite`);
|
|
2242
|
+
if (Number.isSafeInteger(x)) return make(BigInt(x), 1n, NO_IRRATIONALS);
|
|
2184
2243
|
return decimalExactScale(String(x));
|
|
2185
2244
|
}
|
|
2186
2245
|
function binaryExactScale(x) {
|
|
2187
2246
|
if (!Number.isFinite(x)) throw new RangeError(`exact scale: ${x} is not finite`);
|
|
2188
|
-
if (x === 0) return make(0n, 1n,
|
|
2247
|
+
if (x === 0) return make(0n, 1n, NO_IRRATIONALS);
|
|
2189
2248
|
const view = new DataView(new ArrayBuffer(8));
|
|
2190
2249
|
view.setFloat64(0, x);
|
|
2191
2250
|
const bits = view.getBigUint64(0);
|
|
@@ -2195,109 +2254,225 @@ function binaryExactScale(x) {
|
|
|
2195
2254
|
const mantissa = biased === 0 ? fraction : fraction | 1n << 52n;
|
|
2196
2255
|
const exponent = (biased === 0 ? 1 : biased) - 1075;
|
|
2197
2256
|
const num = negative ? -mantissa : mantissa;
|
|
2198
|
-
return exponent >= 0 ? make(num << BigInt(exponent), 1n,
|
|
2257
|
+
return exponent >= 0 ? make(num << BigInt(exponent), 1n, NO_IRRATIONALS) : make(num, 1n << BigInt(-exponent), NO_IRRATIONALS);
|
|
2199
2258
|
}
|
|
2200
2259
|
function ratioExactScale(num, den = 1n) {
|
|
2201
|
-
return make(BigInt(num), BigInt(den),
|
|
2260
|
+
return make(BigInt(num), BigInt(den), NO_IRRATIONALS);
|
|
2202
2261
|
}
|
|
2203
2262
|
function multiplyExactScales(...factors) {
|
|
2263
|
+
if (factors.length === 2) {
|
|
2264
|
+
if (isOne(factors[1])) return factors[0];
|
|
2265
|
+
if (isOne(factors[0])) return factors[1];
|
|
2266
|
+
}
|
|
2204
2267
|
let num = 1n;
|
|
2205
2268
|
let den = 1n;
|
|
2206
|
-
let
|
|
2269
|
+
let irrationals = NO_IRRATIONALS;
|
|
2207
2270
|
for (const f of factors) {
|
|
2208
2271
|
num *= f.num;
|
|
2209
2272
|
den *= f.den;
|
|
2210
|
-
|
|
2273
|
+
irrationals = combinePowers(irrationals, f.irrationals, 1);
|
|
2211
2274
|
}
|
|
2212
|
-
return make(num, den,
|
|
2275
|
+
return make(num, den, irrationals);
|
|
2213
2276
|
}
|
|
2214
2277
|
function divideExactScales(a, b) {
|
|
2215
2278
|
if (b.num === 0n) throw new RangeError("exact scale: division by zero");
|
|
2216
|
-
|
|
2279
|
+
if (isOne(b)) return a;
|
|
2280
|
+
return make(a.num * b.den, a.den * b.num, combinePowers(a.irrationals, b.irrationals, -1));
|
|
2217
2281
|
}
|
|
2218
2282
|
function powerExactScale(a, n) {
|
|
2219
2283
|
if (!Number.isInteger(n)) throw new RangeError(`exact scale: power ${n} is not an integer`);
|
|
2220
2284
|
const k = BigInt(Math.abs(n));
|
|
2221
|
-
const up = make(a.num ** k, a.den ** k, a.
|
|
2285
|
+
const up = make(a.num ** k, a.den ** k, scalePowers(a.irrationals, Math.abs(n)));
|
|
2222
2286
|
return n >= 0 ? up : divideExactScales(UNIT_EXACT_SCALE, up);
|
|
2223
2287
|
}
|
|
2224
2288
|
function exactScalesEqual(a, b) {
|
|
2225
|
-
return a.num === b.num && a.den === b.den && (a.num === 0n || a.
|
|
2289
|
+
return a.num === b.num && a.den === b.den && (a.num === 0n || powersEqual(a.irrationals, b.irrationals));
|
|
2226
2290
|
}
|
|
2227
2291
|
function addExactScales(a, b) {
|
|
2228
2292
|
if (a.num === 0n) return b;
|
|
2229
2293
|
if (b.num === 0n) return a;
|
|
2230
|
-
if (a.
|
|
2231
|
-
return make(a.num * b.den + b.num * a.den, a.den * b.den, a.
|
|
2232
|
-
}
|
|
2233
|
-
var
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
d /= 5n;
|
|
2247
|
-
fives++;
|
|
2248
|
-
}
|
|
2249
|
-
return d === 1n ? Math.max(twos, fives) : null;
|
|
2294
|
+
if (!powersEqual(a.irrationals, b.irrationals)) return null;
|
|
2295
|
+
return make(a.num * b.den + b.num * a.den, a.den * b.den, a.irrationals);
|
|
2296
|
+
}
|
|
2297
|
+
var IRRATIONAL_RATIONALS = Object.freeze(
|
|
2298
|
+
Object.fromEntries(
|
|
2299
|
+
Object.keys(NAMED_IRRATIONALS).map((name2) => [
|
|
2300
|
+
name2,
|
|
2301
|
+
decimalExactScale(NAMED_IRRATIONALS[name2])
|
|
2302
|
+
])
|
|
2303
|
+
)
|
|
2304
|
+
);
|
|
2305
|
+
var SAFE_OPERAND = 1n << 53n;
|
|
2306
|
+
function bitLength(x) {
|
|
2307
|
+
if (x === 0n) return 0;
|
|
2308
|
+
const hex = x.toString(16);
|
|
2309
|
+
return (hex.length - 1) * 4 + (32 - Math.clz32(parseInt(hex[0], 16)));
|
|
2250
2310
|
}
|
|
2251
2311
|
function rationalToNumber(num, den) {
|
|
2252
2312
|
if (num === 0n) return 0;
|
|
2253
2313
|
const negative = num < 0n;
|
|
2254
|
-
const
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
|
|
2314
|
+
const a = negative ? -num : num;
|
|
2315
|
+
if (a <= SAFE_OPERAND && den <= SAFE_OPERAND) {
|
|
2316
|
+
const q = Number(a) / Number(den);
|
|
2317
|
+
return negative ? -q : q;
|
|
2318
|
+
}
|
|
2319
|
+
const e = bitLength(a) - bitLength(den);
|
|
2320
|
+
if (e > 1025) return negative ? -Infinity : Infinity;
|
|
2321
|
+
if (e < -1080) return negative ? -0 : 0;
|
|
2322
|
+
let shift = 52 - e;
|
|
2323
|
+
const quotient = (k) => k >= 0 ? (a << BigInt(k)) / den : a / (den << BigInt(-k));
|
|
2324
|
+
if (quotient(shift) < 1n << 52n) shift += 1;
|
|
2325
|
+
if (shift > 1074) shift = 1074;
|
|
2326
|
+
const n = shift >= 0 ? a << BigInt(shift) : a;
|
|
2327
|
+
const d = shift >= 0 ? den : den << BigInt(-shift);
|
|
2328
|
+
let m = n / d;
|
|
2329
|
+
const twice = 2n * (n % d);
|
|
2330
|
+
if (twice > d || twice === d && m % 2n === 1n) m += 1n;
|
|
2331
|
+
if (m === 1n << 53n) {
|
|
2332
|
+
m >>= 1n;
|
|
2333
|
+
shift -= 1;
|
|
2334
|
+
}
|
|
2335
|
+
if (52 - shift > 1023) return negative ? -Infinity : Infinity;
|
|
2336
|
+
const value = Number(m) * 2 ** -shift;
|
|
2337
|
+
if (!Number.isFinite(value)) return negative ? -Infinity : Infinity;
|
|
2266
2338
|
return negative ? -value : value;
|
|
2267
2339
|
}
|
|
2340
|
+
function scaleToRational(s) {
|
|
2341
|
+
let num = s.num;
|
|
2342
|
+
let den = s.den;
|
|
2343
|
+
for (const name2 of Object.keys(s.irrationals)) {
|
|
2344
|
+
const power = s.irrationals[name2];
|
|
2345
|
+
const c = IRRATIONAL_RATIONALS[name2];
|
|
2346
|
+
const k = BigInt(Math.abs(power));
|
|
2347
|
+
if (power > 0) {
|
|
2348
|
+
num *= c.num ** k;
|
|
2349
|
+
den *= c.den ** k;
|
|
2350
|
+
} else {
|
|
2351
|
+
num *= c.den ** k;
|
|
2352
|
+
den *= c.num ** k;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
return { num, den };
|
|
2356
|
+
}
|
|
2357
|
+
var EXACT_SCALE_NUMBER_CACHE_LIMIT = 4096;
|
|
2358
|
+
var numberCache = /* @__PURE__ */ new Map();
|
|
2359
|
+
var roundedByIdentity = /* @__PURE__ */ new WeakMap();
|
|
2360
|
+
function roundExactScale(s) {
|
|
2361
|
+
let value = roundedByIdentity.get(s);
|
|
2362
|
+
if (value === void 0) {
|
|
2363
|
+
const { num, den } = scaleToRational(s);
|
|
2364
|
+
value = rationalToNumber(num, den);
|
|
2365
|
+
roundedByIdentity.set(s, value);
|
|
2366
|
+
}
|
|
2367
|
+
return value;
|
|
2368
|
+
}
|
|
2369
|
+
function powersKey(p) {
|
|
2370
|
+
let key = "";
|
|
2371
|
+
for (const name2 of Object.keys(p)) key += `|${name2}^${p[name2]}`;
|
|
2372
|
+
return key;
|
|
2373
|
+
}
|
|
2374
|
+
function cacheKey(s) {
|
|
2375
|
+
return `${s.num}/${s.den}${powersKey(s.irrationals)}`;
|
|
2376
|
+
}
|
|
2377
|
+
function clearExactScaleNumberCache() {
|
|
2378
|
+
numberCache.clear();
|
|
2379
|
+
}
|
|
2380
|
+
function exactScaleNumberCacheSize() {
|
|
2381
|
+
return numberCache.size;
|
|
2382
|
+
}
|
|
2268
2383
|
function exactScaleToNumber(s) {
|
|
2269
|
-
|
|
2270
|
-
const
|
|
2271
|
-
|
|
2384
|
+
const key = cacheKey(s);
|
|
2385
|
+
const cached = numberCache.get(key);
|
|
2386
|
+
if (cached !== void 0) {
|
|
2387
|
+
numberCache.delete(key);
|
|
2388
|
+
numberCache.set(key, cached);
|
|
2389
|
+
return cached;
|
|
2390
|
+
}
|
|
2391
|
+
const value = roundExactScale(s);
|
|
2392
|
+
numberCache.set(key, value);
|
|
2393
|
+
if (numberCache.size > EXACT_SCALE_NUMBER_CACHE_LIMIT) {
|
|
2394
|
+
numberCache.delete(numberCache.keys().next().value);
|
|
2395
|
+
}
|
|
2396
|
+
return value;
|
|
2272
2397
|
}
|
|
2273
2398
|
function formatExactScale(s) {
|
|
2274
2399
|
const rational = s.den === 1n ? `${s.num}` : `${s.num}/${s.den}`;
|
|
2275
|
-
|
|
2276
|
-
|
|
2400
|
+
const parts = [rational];
|
|
2401
|
+
for (const name2 of Object.keys(s.irrationals)) {
|
|
2402
|
+
const k = s.irrationals[name2];
|
|
2403
|
+
parts.push(k === 1 ? name2 : `${name2}^${k}`);
|
|
2404
|
+
}
|
|
2405
|
+
return parts.join("*");
|
|
2406
|
+
}
|
|
2407
|
+
var TOKEN = /\s*(?:([()*/])|\^\s*([+-]?\d+)|([^\s*/^()]+))/y;
|
|
2408
|
+
function tokenize(text) {
|
|
2409
|
+
const tokens = [];
|
|
2410
|
+
TOKEN.lastIndex = 0;
|
|
2411
|
+
let at = 0;
|
|
2412
|
+
while (at < text.length) {
|
|
2413
|
+
if (/^\s*$/.test(text.slice(at))) break;
|
|
2414
|
+
TOKEN.lastIndex = at;
|
|
2415
|
+
const m = TOKEN.exec(text);
|
|
2416
|
+
if (m === null) throw new RangeError(`exact scale: '${text}' is not a product of factors`);
|
|
2417
|
+
if (m[1] !== void 0) tokens.push({ kind: "op", op: m[1] });
|
|
2418
|
+
else if (m[2] !== void 0) tokens.push({ kind: "pow", n: Number(m[2]) });
|
|
2419
|
+
else tokens.push({ kind: "atom", text: m[3] });
|
|
2420
|
+
at = TOKEN.lastIndex;
|
|
2421
|
+
}
|
|
2422
|
+
return tokens;
|
|
2277
2423
|
}
|
|
2278
|
-
var FACTOR = /^([^*/^\s()]+)(?:\^([+-]?\d+))?$/;
|
|
2279
2424
|
function readScaleExpression(text, resolve = () => void 0) {
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2425
|
+
const tokens = tokenize(text);
|
|
2426
|
+
let i = 0;
|
|
2427
|
+
const fail = () => {
|
|
2428
|
+
throw new RangeError(`exact scale: '${text}' is not a product of factors`);
|
|
2429
|
+
};
|
|
2430
|
+
const isOp = (op) => {
|
|
2431
|
+
const t = tokens[i];
|
|
2432
|
+
return t !== void 0 && t.kind === "op" && t.op === op;
|
|
2433
|
+
};
|
|
2434
|
+
const factor = () => {
|
|
2435
|
+
const t = tokens[i++];
|
|
2436
|
+
let base;
|
|
2437
|
+
if (t === void 0) return fail();
|
|
2438
|
+
if (t.kind === "op" && t.op === "(") {
|
|
2439
|
+
base = expression();
|
|
2440
|
+
if (!isOp(")")) fail();
|
|
2441
|
+
i++;
|
|
2442
|
+
} else if (t.kind === "atom") {
|
|
2443
|
+
base = decimalExactScale(t.text) ?? (isIrrationalName(t.text) ? namedIrrationalScale(t.text) : resolve(t.text));
|
|
2287
2444
|
if (base === void 0) {
|
|
2288
|
-
throw new RangeError(
|
|
2445
|
+
throw new RangeError(
|
|
2446
|
+
`exact scale: '${text}' names '${t.text}', which is not a known scale`
|
|
2447
|
+
);
|
|
2289
2448
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2449
|
+
} else {
|
|
2450
|
+
return fail();
|
|
2451
|
+
}
|
|
2452
|
+
const p = tokens[i];
|
|
2453
|
+
if (p !== void 0 && p.kind === "pow") {
|
|
2454
|
+
i++;
|
|
2455
|
+
return powerExactScale(base, p.n);
|
|
2456
|
+
}
|
|
2457
|
+
return base;
|
|
2458
|
+
};
|
|
2459
|
+
const product = (denominator) => {
|
|
2460
|
+
let scale = factor();
|
|
2461
|
+
while (isOp("*") || denominator && isOp("/")) {
|
|
2462
|
+
i++;
|
|
2463
|
+
scale = multiplyExactScales(scale, factor());
|
|
2294
2464
|
}
|
|
2295
2465
|
return scale;
|
|
2296
2466
|
};
|
|
2297
|
-
const
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2467
|
+
const expression = () => {
|
|
2468
|
+
const top = product(false);
|
|
2469
|
+
if (!isOp("/")) return top;
|
|
2470
|
+
i++;
|
|
2471
|
+
return divideExactScales(top, product(true));
|
|
2472
|
+
};
|
|
2473
|
+
const result = expression();
|
|
2474
|
+
if (i !== tokens.length) fail();
|
|
2475
|
+
return result;
|
|
2301
2476
|
}
|
|
2302
2477
|
|
|
2303
2478
|
// src/types/unit/unit-table.ts
|
|
@@ -2808,6 +2983,11 @@ function attachExactScale(def, exact, exactOffset) {
|
|
|
2808
2983
|
configurable: true
|
|
2809
2984
|
});
|
|
2810
2985
|
}
|
|
2986
|
+
function liveExactSI(unit) {
|
|
2987
|
+
const exact = unit._exactSI;
|
|
2988
|
+
if (exact === void 0 || typeof unit.value !== "number") return void 0;
|
|
2989
|
+
return unit.value === roundExactScale(exact) ? exact : void 0;
|
|
2990
|
+
}
|
|
2811
2991
|
var prefixScales = /* @__PURE__ */ new WeakMap();
|
|
2812
2992
|
function prefixExactScale(prefix) {
|
|
2813
2993
|
let scale = prefixScales.get(prefix);
|
|
@@ -2817,6 +2997,18 @@ function prefixExactScale(prefix) {
|
|
|
2817
2997
|
}
|
|
2818
2998
|
return scale;
|
|
2819
2999
|
}
|
|
3000
|
+
var definitionIds = /* @__PURE__ */ new WeakMap();
|
|
3001
|
+
var nextDefinitionId = 0;
|
|
3002
|
+
function identityOf(def) {
|
|
3003
|
+
let id = definitionIds.get(def);
|
|
3004
|
+
if (id === void 0) {
|
|
3005
|
+
id = nextDefinitionId++;
|
|
3006
|
+
definitionIds.set(def, id);
|
|
3007
|
+
}
|
|
3008
|
+
return id;
|
|
3009
|
+
}
|
|
3010
|
+
var UNIT_LIST_SCALE_CACHE_LIMIT = 1024;
|
|
3011
|
+
var unitListScales = /* @__PURE__ */ new Map();
|
|
2820
3012
|
function normalizeDegreeSymbols(s) {
|
|
2821
3013
|
return s.replace(/°C/g, "degC").replace(/°F/g, "degF").replace(/°/g, "deg");
|
|
2822
3014
|
}
|
|
@@ -2870,9 +3062,11 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
2870
3062
|
return typeof parse === "function" ? parse.call(BigNumber2, text2) : new BigNumber2(text2);
|
|
2871
3063
|
}
|
|
2872
3064
|
function exactToBigNumber(scale) {
|
|
3065
|
+
const powerOfPi = irrationalPower(scale, "pi");
|
|
3066
|
+
if (Object.keys(scale.irrationals).length !== (powerOfPi === 0 ? 0 : 1)) return void 0;
|
|
2873
3067
|
let v = bigNumberFromText(scale.num.toString()).div(bigNumberFromText(scale.den.toString()));
|
|
2874
3068
|
const pi = BIGNUMBER_PI;
|
|
2875
|
-
for (let k = 0; k < Math.abs(
|
|
3069
|
+
for (let k = 0; k < Math.abs(powerOfPi); k++) v = powerOfPi > 0 ? v.times(pi) : v.div(pi);
|
|
2876
3070
|
return v;
|
|
2877
3071
|
}
|
|
2878
3072
|
function simplestReading(value, scale) {
|
|
@@ -2888,7 +3082,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
2888
3082
|
view.setBigInt64(0, bits + step);
|
|
2889
3083
|
const r = view.getFloat64(0);
|
|
2890
3084
|
if (!Number.isFinite(r) || Math.sign(r) !== Math.sign(start)) continue;
|
|
2891
|
-
if (
|
|
3085
|
+
if (roundExactScale(multiplyExactScales(exactScaleOf(r), scale)) !== value) continue;
|
|
2892
3086
|
const length = String(r).length;
|
|
2893
3087
|
if (length < bestLength) {
|
|
2894
3088
|
best = r;
|
|
@@ -2905,14 +3099,14 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
2905
3099
|
const reading = scale === null ? void 0 : simplestReading(value, scale);
|
|
2906
3100
|
if (reading !== void 0) normalized = multiplyExactScales(exactScaleOf(reading), scale);
|
|
2907
3101
|
const sum = addExactScales(normalized, shift);
|
|
2908
|
-
return sum === null ? void 0 :
|
|
3102
|
+
return sum === null ? void 0 : roundExactScale(sum);
|
|
2909
3103
|
}
|
|
2910
3104
|
const s = exactAs(shift, typeOf(value));
|
|
2911
3105
|
return s === void 0 ? void 0 : addScalar2(value, s);
|
|
2912
3106
|
}
|
|
2913
3107
|
function exactAs(scale, type) {
|
|
2914
3108
|
if (type === "Fraction") {
|
|
2915
|
-
return scale
|
|
3109
|
+
return isRationalScale(scale) ? new Fraction2(scale.num, scale.den) : void 0;
|
|
2916
3110
|
}
|
|
2917
3111
|
if (type === "BigNumber") return exactToBigNumber(scale);
|
|
2918
3112
|
return void 0;
|
|
@@ -2921,7 +3115,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
2921
3115
|
if (typeof value === "number") {
|
|
2922
3116
|
if (!Number.isFinite(value) || value === 0) return void 0;
|
|
2923
3117
|
const x = divide ? binaryExactScale(value) : exactScaleOf(value);
|
|
2924
|
-
return
|
|
3118
|
+
return roundExactScale(
|
|
2925
3119
|
divide ? divideExactScales(x, scale) : multiplyExactScales(x, scale)
|
|
2926
3120
|
);
|
|
2927
3121
|
}
|
|
@@ -2957,7 +3151,14 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
2957
3151
|
"Second parameter in Unit constructor must be a string or valueless Unit"
|
|
2958
3152
|
);
|
|
2959
3153
|
}
|
|
2960
|
-
this.
|
|
3154
|
+
this._exactSI = void 0;
|
|
3155
|
+
const scale = typeof value === "number" && Number.isFinite(value) && value !== 0 && this.units.length > 0 ? this.exactScale() : null;
|
|
3156
|
+
if (scale !== null) {
|
|
3157
|
+
this._exactSI = multiplyExactScales(exactScaleOf(value), scale);
|
|
3158
|
+
this.value = roundExactScale(this._exactSI);
|
|
3159
|
+
} else {
|
|
3160
|
+
this.value = this._normalize(value);
|
|
3161
|
+
}
|
|
2961
3162
|
};
|
|
2962
3163
|
Object.defineProperty(Unit2, "name", { value: "Unit" });
|
|
2963
3164
|
Unit2.prototype.constructor = Unit2;
|
|
@@ -3195,6 +3396,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3195
3396
|
unit.fixPrefix = this.fixPrefix;
|
|
3196
3397
|
unit.skipAutomaticSimplification = this.skipAutomaticSimplification;
|
|
3197
3398
|
unit.value = clone(this.value);
|
|
3399
|
+
unit._exactSI = this._exactSI;
|
|
3198
3400
|
unit.dimensions = this.dimensions.slice(0);
|
|
3199
3401
|
unit.units = [];
|
|
3200
3402
|
for (let i = 0; i < this.units.length; i++) {
|
|
@@ -3219,8 +3421,22 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3219
3421
|
return this.units.length > 1 || Math.abs(this.units[0].power - 1) > 1e-15;
|
|
3220
3422
|
};
|
|
3221
3423
|
Unit2.prototype.exactScale = function() {
|
|
3222
|
-
let
|
|
3424
|
+
let key = "";
|
|
3223
3425
|
for (const component of this.units) {
|
|
3426
|
+
key += `${identityOf(component.unit)}:${identityOf(component.prefix)}^${component.power};`;
|
|
3427
|
+
}
|
|
3428
|
+
const cached = unitListScales.get(key);
|
|
3429
|
+
if (cached !== void 0) return cached;
|
|
3430
|
+
const scale = unitListExactScale(this);
|
|
3431
|
+
unitListScales.set(key, scale);
|
|
3432
|
+
if (unitListScales.size > UNIT_LIST_SCALE_CACHE_LIMIT) {
|
|
3433
|
+
unitListScales.delete(unitListScales.keys().next().value);
|
|
3434
|
+
}
|
|
3435
|
+
return scale;
|
|
3436
|
+
};
|
|
3437
|
+
function unitListExactScale(unit) {
|
|
3438
|
+
let scale = UNIT_EXACT_SCALE;
|
|
3439
|
+
for (const component of unit.units) {
|
|
3224
3440
|
const unitScale = component.unit.exact;
|
|
3225
3441
|
const prefixScale = prefixExactScale(component.prefix);
|
|
3226
3442
|
if (unitScale === void 0 || prefixScale === null || !Number.isInteger(component.power)) {
|
|
@@ -3232,7 +3448,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3232
3448
|
);
|
|
3233
3449
|
}
|
|
3234
3450
|
return scale;
|
|
3235
|
-
}
|
|
3451
|
+
}
|
|
3236
3452
|
Unit2.exactScale = function(valuelessUnit) {
|
|
3237
3453
|
return Unit2.parse(valuelessUnit).exactScale();
|
|
3238
3454
|
};
|
|
@@ -3261,6 +3477,13 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3261
3477
|
}
|
|
3262
3478
|
const scale = this.exactScale();
|
|
3263
3479
|
if (scale !== null) {
|
|
3480
|
+
if (this._exactSI !== void 0 && this._exactSI !== null) {
|
|
3481
|
+
const exactSiNumber = roundExactScale(this._exactSI);
|
|
3482
|
+
if (typeof value === "number" && value === exactSiNumber) {
|
|
3483
|
+
return roundExactScale(divideExactScales(this._exactSI, scale));
|
|
3484
|
+
}
|
|
3485
|
+
this._exactSI = void 0;
|
|
3486
|
+
}
|
|
3264
3487
|
const exact = applyExactScale(value, scale, true);
|
|
3265
3488
|
if (exact !== void 0) return exact;
|
|
3266
3489
|
}
|
|
@@ -3343,8 +3566,10 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3343
3566
|
const valThis = this.value === null ? this._normalize(one(other.value)) : this.value;
|
|
3344
3567
|
const valOther = other.value === null ? other._normalize(one(this.value)) : other.value;
|
|
3345
3568
|
res.value = multiplyScalar2(valThis, valOther);
|
|
3569
|
+
res._exactSI = void 0;
|
|
3346
3570
|
} else {
|
|
3347
3571
|
res.value = null;
|
|
3572
|
+
res._exactSI = void 0;
|
|
3348
3573
|
}
|
|
3349
3574
|
if (isUnit(_other)) {
|
|
3350
3575
|
res.skipAutomaticSimplification = false;
|
|
@@ -3374,8 +3599,10 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3374
3599
|
const valThis = this.value === null ? this._normalize(one(other.value)) : this.value;
|
|
3375
3600
|
const valOther = other.value === null ? other._normalize(one(this.value)) : other.value;
|
|
3376
3601
|
res.value = divideScalar2(valThis, valOther);
|
|
3602
|
+
res._exactSI = void 0;
|
|
3377
3603
|
} else {
|
|
3378
3604
|
res.value = null;
|
|
3605
|
+
res._exactSI = void 0;
|
|
3379
3606
|
}
|
|
3380
3607
|
if (isUnit(_other)) {
|
|
3381
3608
|
res.skipAutomaticSimplification = false;
|
|
@@ -3395,8 +3622,10 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3395
3622
|
}
|
|
3396
3623
|
if (res.value !== null) {
|
|
3397
3624
|
res.value = pow2(res.value, p);
|
|
3625
|
+
res._exactSI = void 0;
|
|
3398
3626
|
} else {
|
|
3399
3627
|
res.value = null;
|
|
3628
|
+
res._exactSI = void 0;
|
|
3400
3629
|
}
|
|
3401
3630
|
res.skipAutomaticSimplification = false;
|
|
3402
3631
|
return getNumericIfUnitless(res);
|
|
@@ -3489,7 +3718,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3489
3718
|
const def = ret.units[0].unit;
|
|
3490
3719
|
const exactOffset = def.exact === void 0 ? void 0 : multiplyExactScales(def.exact, def.exactOffset ?? UNIT_ZERO_SCALE);
|
|
3491
3720
|
const valueType = typeOf(ret.value);
|
|
3492
|
-
const unitOffset = exactOffset === void 0 ? multiplyScalar2(convert(def.value), convert(def.offset)) : valueType === "number" ?
|
|
3721
|
+
const unitOffset = exactOffset === void 0 ? multiplyScalar2(convert(def.value), convert(def.offset)) : valueType === "number" ? roundExactScale(exactOffset) : exactAs(exactOffset, valueType) ?? multiplyScalar2(convert(def.value), convert(def.offset));
|
|
3493
3722
|
ret.value = subtractScalar3(abs2(addScalar2(ret.value, unitOffset)), unitOffset);
|
|
3494
3723
|
}
|
|
3495
3724
|
}
|
|
@@ -3521,11 +3750,24 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3521
3750
|
}
|
|
3522
3751
|
if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) {
|
|
3523
3752
|
other.value = clone(value);
|
|
3753
|
+
other._exactSI = liveExactSI(this);
|
|
3524
3754
|
} else {
|
|
3525
3755
|
const shift = exactOffsetShift(this.units[0].unit, other.units[0].unit);
|
|
3756
|
+
const exactSI = liveExactSI(this);
|
|
3757
|
+
if (shift !== null && exactSI) {
|
|
3758
|
+
const sum = addExactScales(exactSI, shift);
|
|
3759
|
+
if (sum !== null) {
|
|
3760
|
+
other._exactSI = sum;
|
|
3761
|
+
other.value = roundExactScale(sum);
|
|
3762
|
+
other.fixPrefix = true;
|
|
3763
|
+
other.skipAutomaticSimplification = true;
|
|
3764
|
+
return other;
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3526
3767
|
const shifted = shift === null ? void 0 : addExactShift(this, value, shift);
|
|
3527
3768
|
if (shifted !== void 0) {
|
|
3528
3769
|
other.value = shifted;
|
|
3770
|
+
other._exactSI = void 0;
|
|
3529
3771
|
other.fixPrefix = true;
|
|
3530
3772
|
other.skipAutomaticSimplification = true;
|
|
3531
3773
|
return other;
|
|
@@ -3870,7 +4112,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3870
4112
|
const exact = unitPrefixExactScale(prefix);
|
|
3871
4113
|
const def = {
|
|
3872
4114
|
name: name2,
|
|
3873
|
-
value:
|
|
4115
|
+
value: roundExactScale(exact),
|
|
3874
4116
|
scientific: prefix.scientific
|
|
3875
4117
|
};
|
|
3876
4118
|
prefixScales.set(def, exact);
|
|
@@ -3998,14 +4240,14 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
3998
4240
|
for (const key of Object.keys(UNIT_ROWS)) {
|
|
3999
4241
|
const row = UNIT_ROWS[key];
|
|
4000
4242
|
const exact = readUnitScale(row.scale);
|
|
4001
|
-
const scaled =
|
|
4243
|
+
const scaled = roundExactScale(exact);
|
|
4002
4244
|
const exactOffset = row.offset === void 0 ? UNIT_ZERO_SCALE : readUnitScale(row.offset);
|
|
4003
4245
|
const def = {
|
|
4004
4246
|
name: row.name ?? key,
|
|
4005
4247
|
base: BASE_UNITS[row.base],
|
|
4006
4248
|
prefixes: PREFIXES[row.prefixes],
|
|
4007
4249
|
value: row.imaginary ? imaginaryValue(scaled) : scaled,
|
|
4008
|
-
offset:
|
|
4250
|
+
offset: roundExactScale(exactOffset)
|
|
4009
4251
|
};
|
|
4010
4252
|
if (row.reciprocal) def.reciprocal = true;
|
|
4011
4253
|
if (!row.imaginary) attachExactScale(def, exact, exactOffset);
|
|
@@ -4015,8 +4257,8 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
4015
4257
|
for (const key in UNITS) {
|
|
4016
4258
|
if (!hasOwnProperty(UNITS, key)) continue;
|
|
4017
4259
|
const exact = UNITS[key].exact;
|
|
4018
|
-
if (exact === void 0 || exact
|
|
4019
|
-
UNITS[key].value = config3.number === "BigNumber" ? exactToBigNumber(exact) :
|
|
4260
|
+
if (exact === void 0 || irrationalPower(exact, "pi") === 0) continue;
|
|
4261
|
+
UNITS[key].value = (config3.number === "BigNumber" ? exactToBigNumber(exact) : void 0) ?? roundExactScale(exact);
|
|
4020
4262
|
}
|
|
4021
4263
|
}
|
|
4022
4264
|
if (on) {
|
|
@@ -5780,8 +6022,13 @@ export {
|
|
|
5780
6022
|
BIGNUMBER_LN10,
|
|
5781
6023
|
UnitParseError,
|
|
5782
6024
|
DimensionMismatchError,
|
|
6025
|
+
NAMED_IRRATIONALS,
|
|
6026
|
+
irrationalPower,
|
|
6027
|
+
isRationalScale,
|
|
5783
6028
|
UNIT_EXACT_SCALE,
|
|
6029
|
+
namedIrrationalScale,
|
|
5784
6030
|
PI_EXACT_SCALE,
|
|
6031
|
+
LN2_EXACT_SCALE,
|
|
5785
6032
|
decimalExactScale,
|
|
5786
6033
|
exactScaleOf,
|
|
5787
6034
|
binaryExactScale,
|
|
@@ -5791,6 +6038,8 @@ export {
|
|
|
5791
6038
|
powerExactScale,
|
|
5792
6039
|
exactScalesEqual,
|
|
5793
6040
|
addExactScales,
|
|
6041
|
+
clearExactScaleNumberCache,
|
|
6042
|
+
exactScaleNumberCacheSize,
|
|
5794
6043
|
exactScaleToNumber,
|
|
5795
6044
|
formatExactScale,
|
|
5796
6045
|
readScaleExpression,
|
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export { addScalar, subtractScalar, multiplyScalar, divideScalar, pow, abs, fix,
|
|
|
17
17
|
export type { NumericScalar } from './arithmetic/scalar.js';
|
|
18
18
|
export { Unit, isUnit as isUnitValue, DimensionMismatchError, UnitParseError, DIMENSIONLESS, dim, } from './types/unit.js';
|
|
19
19
|
export type { Dimensions, UnitDef, UnitInstance } from './types/unit.js';
|
|
20
|
-
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './types/unit.js';
|
|
21
|
-
export type { ExactScale, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './types/unit.js';
|
|
20
|
+
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './types/unit.js';
|
|
21
|
+
export type { ExactScale, IrrationalName, IrrationalPowers, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './types/unit.js';
|
|
22
22
|
export { UNIT_DIMENSION_LENGTH, SI_DIMENSION_LENGTH, toSiDimensions, toSiDimensionVector, fromSiDimensions, fromSiDimensionVector, } from './types/unit.js';
|
|
23
23
|
export type { SiDimensionVector, SiDimensionOptions } from './types/unit.js';
|
|
24
24
|
export { BASE_UNITS, DERIVED_UNITS, ALL_UNITS, UNIT_ALIASES, getUnitDef, } from './types/unit-definitions.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,YAAY,EACV,WAAW,EACX,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,OAAO,EACP,SAAS,EACT,CAAC,EACD,YAAY,EACZ,WAAW,EACX,eAAe,GAChB,MAAM,oBAAoB,CA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,WAAW,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,GACrB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
FRACTION_ZERO,
|
|
22
22
|
Fraction,
|
|
23
23
|
I,
|
|
24
|
+
LN2_EXACT_SCALE,
|
|
25
|
+
NAMED_IRRATIONALS,
|
|
24
26
|
NAMED_SCALES,
|
|
25
27
|
PI_EXACT_SCALE,
|
|
26
28
|
UNIT_EXACT_SCALE,
|
|
@@ -33,10 +35,12 @@ import {
|
|
|
33
35
|
addExactScales,
|
|
34
36
|
addScalar,
|
|
35
37
|
binaryExactScale,
|
|
38
|
+
clearExactScaleNumberCache,
|
|
36
39
|
decimalExactScale,
|
|
37
40
|
divideExactScales,
|
|
38
41
|
divideScalar,
|
|
39
42
|
equal,
|
|
43
|
+
exactScaleNumberCacheSize,
|
|
40
44
|
exactScaleOf,
|
|
41
45
|
exactScaleToNumber,
|
|
42
46
|
exactScalesEqual,
|
|
@@ -46,16 +50,19 @@ import {
|
|
|
46
50
|
formatExactScale,
|
|
47
51
|
getUnitPrefix,
|
|
48
52
|
getUnitRow,
|
|
53
|
+
irrationalPower,
|
|
49
54
|
isBigInt,
|
|
50
55
|
isBigNumber,
|
|
51
56
|
isBigNumber2,
|
|
52
57
|
isComplex2 as isComplex,
|
|
53
58
|
isFraction2 as isFraction,
|
|
54
59
|
isNumeric,
|
|
60
|
+
isRationalScale,
|
|
55
61
|
isUnit,
|
|
56
62
|
multiplyExactScales,
|
|
57
63
|
multiplyScalar,
|
|
58
64
|
namedExactScale,
|
|
65
|
+
namedIrrationalScale,
|
|
59
66
|
nearlyEqual,
|
|
60
67
|
number,
|
|
61
68
|
pow,
|
|
@@ -70,7 +77,7 @@ import {
|
|
|
70
77
|
unitRowExactOffset,
|
|
71
78
|
unitRowExactScale,
|
|
72
79
|
unitRowValue
|
|
73
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-UEBMU6EV.js";
|
|
74
81
|
|
|
75
82
|
// src/types/matrix/Range.ts
|
|
76
83
|
var name = "Range";
|
|
@@ -1446,7 +1453,7 @@ function neumaierCumsum(xs, out) {
|
|
|
1446
1453
|
}
|
|
1447
1454
|
|
|
1448
1455
|
// src/index.ts
|
|
1449
|
-
var VERSION = "0.
|
|
1456
|
+
var VERSION = "0.18.0";
|
|
1450
1457
|
export {
|
|
1451
1458
|
ALL_UNITS,
|
|
1452
1459
|
BASE_UNITS,
|
|
@@ -1482,10 +1489,12 @@ export {
|
|
|
1482
1489
|
I,
|
|
1483
1490
|
LN10,
|
|
1484
1491
|
LN2,
|
|
1492
|
+
LN2_EXACT_SCALE,
|
|
1485
1493
|
LOG10E,
|
|
1486
1494
|
LOG2E,
|
|
1487
1495
|
MATHTS_CONVERSIONS,
|
|
1488
1496
|
MATHTS_TYPES,
|
|
1497
|
+
NAMED_IRRATIONALS,
|
|
1489
1498
|
NAMED_SCALES,
|
|
1490
1499
|
PHI,
|
|
1491
1500
|
PI,
|
|
@@ -1510,6 +1519,7 @@ export {
|
|
|
1510
1519
|
addExactScales,
|
|
1511
1520
|
addScalar,
|
|
1512
1521
|
binaryExactScale,
|
|
1522
|
+
clearExactScaleNumberCache,
|
|
1513
1523
|
create,
|
|
1514
1524
|
createFactory,
|
|
1515
1525
|
createMathTSTyped,
|
|
@@ -1520,6 +1530,7 @@ export {
|
|
|
1520
1530
|
divideExactScales,
|
|
1521
1531
|
divideScalar,
|
|
1522
1532
|
equal,
|
|
1533
|
+
exactScaleNumberCacheSize,
|
|
1523
1534
|
exactScaleOf,
|
|
1524
1535
|
exactScaleToNumber,
|
|
1525
1536
|
exactScalesEqual,
|
|
@@ -1532,6 +1543,7 @@ export {
|
|
|
1532
1543
|
getUnitPrefix,
|
|
1533
1544
|
getUnitRow,
|
|
1534
1545
|
initTypedWasm,
|
|
1546
|
+
irrationalPower,
|
|
1535
1547
|
isArray,
|
|
1536
1548
|
isBigInt2 as isBigInt,
|
|
1537
1549
|
isBigNumber2 as isBigNumber,
|
|
@@ -1546,6 +1558,7 @@ export {
|
|
|
1546
1558
|
isNumber,
|
|
1547
1559
|
isNumeric,
|
|
1548
1560
|
isObject,
|
|
1561
|
+
isRationalScale,
|
|
1549
1562
|
isSparseMatrix,
|
|
1550
1563
|
isString,
|
|
1551
1564
|
isTypedWasmAvailable,
|
|
@@ -1557,6 +1570,7 @@ export {
|
|
|
1557
1570
|
multiplyExactScales,
|
|
1558
1571
|
multiplyScalar,
|
|
1559
1572
|
namedExactScale,
|
|
1573
|
+
namedIrrationalScale,
|
|
1560
1574
|
neumaierCumsum,
|
|
1561
1575
|
neumaierSum,
|
|
1562
1576
|
norm2,
|
package/dist/internal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/types/unit/Unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAcV,eAAe,EAQhB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/types/unit/Unit.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAcV,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AAqIzB,eAAO,MAAM,eAAe,6DAigF3B,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Exact unit scales.
|
|
3
3
|
*
|
|
4
|
-
* A unit's scale to SI is a rational number times
|
|
5
|
-
* `num / den ×
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A unit's scale to SI is a rational number times integer powers of named
|
|
5
|
+
* irrationals: `num / den × Π name^k`. The names come from one registry,
|
|
6
|
+
* {@link NAMED_IRRATIONALS} (π and ln 2 today); adding a constant is one entry
|
|
7
|
+
* there. Products, quotients and integer powers stay exact, so a scale is
|
|
8
|
+
* rounded to a double once, at the end, by {@link exactScaleToNumber}. `psi`
|
|
9
|
+
* stated as `lbf/inch^2` is therefore the double nearest
|
|
8
10
|
* 0.45359237 × 9.80665 / 0.0254², not the result of three rounded float steps.
|
|
9
11
|
*
|
|
10
12
|
* A decimal literal (`'0.0254'`, `'1.602176634e-19'`) is read digit for digit.
|
|
@@ -13,23 +15,50 @@
|
|
|
13
15
|
*
|
|
14
16
|
* Scale expressions (the form the unit table states its rows in) are factors
|
|
15
17
|
* joined by `*`, optionally followed by one `/` and the denominator's factors.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* A factor is a decimal literal, a registered irrational name, a named scale,
|
|
19
|
+
* or a parenthesized expression, with an optional integer power `^n`.
|
|
20
|
+
* Whitespace between tokens is ignored. Everything after the first `/` at one
|
|
21
|
+
* level is the denominator (ISO 80000-1 single-solidus reading): `a/b*c` is
|
|
22
|
+
* a/(b·c), and `a/(b*c)` says the same with explicit grouping.
|
|
19
23
|
*
|
|
20
24
|
* @module @danielsimonjr/mathts-core/types/unit/exact-scale
|
|
21
25
|
*/
|
|
22
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The named irrationals a scale may carry, each as a decimal truncated to 120
|
|
28
|
+
* places. Rounding `r × Π c^k` through these rationals is off from rounding the
|
|
29
|
+
* true value only if the true value lies within about 1e-118 (relative) of a
|
|
30
|
+
* midpoint between two doubles. The test files pin each entry's digits against
|
|
31
|
+
* an independent computation. The constants are treated as algebraically
|
|
32
|
+
* independent over Q (true for π and ln 2), so scales with different powers do
|
|
33
|
+
* not add.
|
|
34
|
+
*/
|
|
35
|
+
export declare const NAMED_IRRATIONALS: Readonly<{
|
|
36
|
+
readonly pi: '3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647';
|
|
37
|
+
readonly ln2: '0.693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481020570685733';
|
|
38
|
+
}>;
|
|
39
|
+
/** A name in {@link NAMED_IRRATIONALS}. */
|
|
40
|
+
export type IrrationalName = keyof typeof NAMED_IRRATIONALS;
|
|
41
|
+
/** Integer powers of named irrationals; a name with power 0 is absent. */
|
|
42
|
+
export type IrrationalPowers = Readonly<Partial<Record<IrrationalName, number>>>;
|
|
43
|
+
/** `num / den × Π name^power`, with `den > 0` and the fraction in lowest terms. */
|
|
23
44
|
export interface ExactScale {
|
|
24
45
|
readonly num: bigint;
|
|
25
46
|
readonly den: bigint;
|
|
26
|
-
/**
|
|
27
|
-
readonly
|
|
47
|
+
/** Nonzero integer powers of named irrationals (`{ pi: 1 }` for `deg = pi/180`, `{}` when rational). */
|
|
48
|
+
readonly irrationals: IrrationalPowers;
|
|
28
49
|
}
|
|
50
|
+
/** The power of `name` in `s` (0 when absent). */
|
|
51
|
+
export declare function irrationalPower(s: ExactScale, name: IrrationalName): number;
|
|
52
|
+
/** Whether `s` is a plain rational (no irrational factor). */
|
|
53
|
+
export declare function isRationalScale(s: ExactScale): boolean;
|
|
29
54
|
/** The scale 1. */
|
|
30
55
|
export declare const UNIT_EXACT_SCALE: ExactScale;
|
|
56
|
+
/** A registered irrational itself, as a scale (`namedIrrationalScale('pi')` is π). */
|
|
57
|
+
export declare function namedIrrationalScale(name: IrrationalName): ExactScale;
|
|
31
58
|
/** π itself, as a scale. */
|
|
32
59
|
export declare const PI_EXACT_SCALE: ExactScale;
|
|
60
|
+
/** ln 2 itself, as a scale. */
|
|
61
|
+
export declare const LN2_EXACT_SCALE: ExactScale;
|
|
33
62
|
/** The exact value of a decimal literal, or null when `text` is not one. */
|
|
34
63
|
export declare function decimalExactScale(text: string): ExactScale | null;
|
|
35
64
|
/** The exact decimal a finite JavaScript number prints as (its shortest round-trip form). */
|
|
@@ -50,16 +79,41 @@ export declare function divideExactScales(a: ExactScale, b: ExactScale): ExactSc
|
|
|
50
79
|
export declare function powerExactScale(a: ExactScale, n: number): ExactScale;
|
|
51
80
|
/** Whether two exact scales are the same number. */
|
|
52
81
|
export declare function exactScalesEqual(a: ExactScale, b: ExactScale): boolean;
|
|
53
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* `a + b`, when both carry the same irrational powers; null otherwise (the
|
|
84
|
+
* registered irrationals are taken as algebraically independent over Q).
|
|
85
|
+
*/
|
|
54
86
|
export declare function addExactScales(a: ExactScale, b: ExactScale): ExactScale | null;
|
|
55
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* The most results {@link exactScaleToNumber} keeps. Unit readings reach it as exact scales,
|
|
89
|
+
* so one entry per distinct reading would grow without bound.
|
|
90
|
+
*/
|
|
91
|
+
export declare const EXACT_SCALE_NUMBER_CACHE_LIMIT = 4096;
|
|
92
|
+
/**
|
|
93
|
+
* The scale as a double, rounded once, remembered for this scale object only. For one-off
|
|
94
|
+
* scales (a unit's exact reading) this skips the string-keyed memo of {@link exactScaleToNumber},
|
|
95
|
+
* whose key would cost as much as the rounding.
|
|
96
|
+
*/
|
|
97
|
+
export declare function roundExactScale(s: ExactScale): number;
|
|
98
|
+
/** Drop the {@link exactScaleToNumber} memo table (tests). */
|
|
99
|
+
export declare function clearExactScaleNumberCache(): void;
|
|
100
|
+
/** How many exact scales have a cached double (tests / diagnostics). */
|
|
101
|
+
export declare function exactScaleNumberCacheSize(): number;
|
|
102
|
+
/** Whether the scale has a cached double. Reads the memo without changing its order (tests). */
|
|
103
|
+
export declare function exactScaleNumberCacheHas(s: ExactScale): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The scale as a double, rounded once. Repeated calls reuse a memoized result. The memo keeps at
|
|
106
|
+
* most {@link EXACT_SCALE_NUMBER_CACHE_LIMIT} results; when it is full, the entry that was used
|
|
107
|
+
* longest ago leaves first (a `Map` iterates in insertion order, and a hit re-inserts its key).
|
|
108
|
+
*/
|
|
56
109
|
export declare function exactScaleToNumber(s: ExactScale): number;
|
|
57
|
-
/** The scale as text: `num/den`,
|
|
110
|
+
/** The scale as text: `num/den`, then `*name` / `*name^k` for each irrational factor. */
|
|
58
111
|
export declare function formatExactScale(s: ExactScale): string;
|
|
59
112
|
/**
|
|
60
113
|
* The exact value of a scale expression (`'lbf/inch^2'`, `'648000*astronomical_unit/pi'`,
|
|
61
|
-
* `'101325/760'`). `resolve` gives a name its scale and returns
|
|
62
|
-
* name it does not know, which throws here.
|
|
114
|
+
* `'101325/760'`, `'ln2'`, `'1/(2 * pi)'`). `resolve` gives a name its scale and returns
|
|
115
|
+
* undefined for a name it does not know, which throws here. A name in
|
|
116
|
+
* {@link NAMED_IRRATIONALS} always means that constant.
|
|
63
117
|
*/
|
|
64
118
|
export declare function readScaleExpression(text: string, resolve?: (name: string) => ExactScale | undefined): ExactScale;
|
|
65
119
|
//# sourceMappingURL=exact-scale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exact-scale.d.ts","sourceRoot":"","sources":["../../../src/types/unit/exact-scale.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exact-scale.d.ts","sourceRoot":"","sources":["../../../src/types/unit/exact-scale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;iBACxB,4HAA4H;kBAC3H,4HAA4H;EACxH,CAAC;AAEZ,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE5D,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAEjF,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wGAAwG;IACxG,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;CACxC;AAMD,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAE3E;AAED,8DAA8D;AAC9D,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AAM,8BAA8B,OAAO,CAAC;AAUnD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAQrD;AAYD,8DAA8D;AAC9D,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAED,wEAAwE;AACxE,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAcxD;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAQtD;AAyBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GAAG,SAA2B,GAClE,UAAU,CA2DZ"}
|
|
@@ -2,8 +2,8 @@ import type { UnitConstructor } from './unit-types.js';
|
|
|
2
2
|
export { createUnitClass } from './Unit.js';
|
|
3
3
|
export { unitDependencies } from './dependencies.js';
|
|
4
4
|
export type * from './unit-types.js';
|
|
5
|
-
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, formatExactScale, readScaleExpression, } from './exact-scale.js';
|
|
6
|
-
export type { ExactScale } from './exact-scale.js';
|
|
5
|
+
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, } from './exact-scale.js';
|
|
6
|
+
export type { ExactScale, IrrationalName, IrrationalPowers } from './exact-scale.js';
|
|
7
7
|
export { NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit-table.js';
|
|
8
8
|
export type { UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix } from './unit-table.js';
|
|
9
9
|
/** The core `Unit` class, pre-wired to core's numeric primitives. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/unit/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/unit/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1F,qEAAqE;AACrE,eAAO,MAAM,IAAI,EAAE,eAEC,CAAC"}
|
|
@@ -174,6 +174,12 @@ export interface UnitDependencies {
|
|
|
174
174
|
/** An instance of Unit (the prototype methods + per-instance fields). */
|
|
175
175
|
export interface UnitInstance {
|
|
176
176
|
value: Numeric | null;
|
|
177
|
+
/**
|
|
178
|
+
* Exact SI quantity for a number reading that was normalized through exact
|
|
179
|
+
* scales. Present so A→B conversions can round once. A reader uses it only
|
|
180
|
+
* while `value` is still the double this quantity rounds to.
|
|
181
|
+
*/
|
|
182
|
+
_exactSI?: ExactScale;
|
|
177
183
|
units: UnitComponent[];
|
|
178
184
|
dimensions: number[];
|
|
179
185
|
fixPrefix: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-types.d.ts","sourceRoot":"","sources":["../../../src/types/unit/unit-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,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AAC;IACzD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IACvC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,IAAI,MAAM,GAAG,SAAS,CAAC;IACpC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC;IAChG,6EAA6E;IAC7E,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;IACrD,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC5D,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAE/C,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC"}
|
package/dist/types/unit.d.ts
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export { Unit, createUnitClass, unitDependencies } from './unit/index.js';
|
|
23
23
|
export type { UnitInstance } from './unit/index.js';
|
|
24
|
-
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit/index.js';
|
|
25
|
-
export type { ExactScale, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './unit/index.js';
|
|
24
|
+
export { UNIT_EXACT_SCALE, PI_EXACT_SCALE, LN2_EXACT_SCALE, NAMED_IRRATIONALS, namedIrrationalScale, irrationalPower, isRationalScale, decimalExactScale, exactScaleOf, binaryExactScale, ratioExactScale, multiplyExactScales, divideExactScales, powerExactScale, addExactScales, exactScalesEqual, exactScaleToNumber, clearExactScaleNumberCache, exactScaleNumberCacheSize, formatExactScale, readScaleExpression, NAMED_SCALES, UNIT_ROWS, UNIT_ROW_ALIASES, namedExactScale, readUnitScale, getUnitRow, unitRowExactScale, unitRowValue, unitRowExactOffset, UNIT_PREFIX_SETS, unitPrefixExactScale, getUnitPrefix, } from './unit/index.js';
|
|
25
|
+
export type { ExactScale, IrrationalName, IrrationalPowers, UnitRow, UnitBaseKey, UnitPrefixSetKey, UnitPrefix, } from './unit/index.js';
|
|
26
26
|
export { DimensionMismatchError, UnitParseError } from './unit/errors.js';
|
|
27
27
|
export { isUnit } from '../is.js';
|
|
28
28
|
export { DIMENSIONLESS, dim } from './unit-definitions.js';
|
package/dist/types/unit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit.d.ts","sourceRoot":"","sources":["../../src/types/unit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CA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