MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / nextUp

Function nextUp

src/compute-engine/numerics/numeric.ts:51–68  ·  view source on GitHub ↗
(x: number)

Source from the content-addressed store, hash-verified

49 * it can guard a frequent operation.
50 */
51export function isOutsideNormalDoubleRange(x: number): boolean {
52 return !(
53 Math.abs(x) >= 2.2250738585072014e-308 && Math.abs(x) <= Number.MAX_VALUE
54 );
55}
56
57// When applying simplifications, only considers integers whose absolute value
58// is less than SMALL_INTEGER. This avoid loss of precision by preventing
59// simplification for `1e199 + 1`.
60// Note: SMALL_INTEGER ≈ 10^(MACHINE_PRECISION / 2)
61// so that the product of two small integers does not lose precision
62export const SMALL_INTEGER = 1000000;
63
64/** The largest number of digits of a bigint */
65export const MAX_BIGINT_DIGITS = 1024;
66
67// When doing a calculation via iteration (e.g. to calculate a sum)
68// do not iterate more than this value
69// Reduced from 1,000,000 to 10,000 for better test performance
70// while still being sufficient for most practical calculations
71export const MAX_ITERATION = 10000;

Callers 1

nextDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected