CKTIS / JavaScript
Number.MIN_SAFE_INTEGER: lower safe-integer boundary
Number.MIN_SAFE_INTEGER has the exact value −(2^53−1), or -9007199254740991, and marks the negative boundary of Number’s safe integer range.
Version: ECMAScript 2015 onward; example target: Node.js 24.22.2
Syntax
Number.MIN_SAFE_INTEGERNumber.MIN_SAFE_INTEGER equals -(2 ** 53 - 1), exactly -9007199254740991. Integral Number values from this boundary through Number.MAX_SAFE_INTEGER are safe: consecutive integers remain distinguishable. The constant is not the most negative finite Number, which is -Number.MAX_VALUE, nor Number.MIN_VALUE, which denotes the smallest positive subnormal value.
-(2 ** 53) is still exactly representable, but is not a safe integer because not every following integer remains distinguishable. Number.MIN_SAFE_INTEGER - 1 and Number.MIN_SAFE_INTEGER - 2 produce the same Number. When a negative value comes from long text, conversion to Number can lose precision before the boundary is checked.
The property has existed since ECMAScript 2015 and is non-writable, non-enumerable, and non-configurable. The example validates a signed adjustment within the safe range and demonstrates the first collision below the boundary. For exact integers with larger magnitude, preserve their text or use BigInt.
Examples
const limit = Number.MIN_SAFE_INTEGER;
const validAdjustment = value =>
Number.isSafeInteger(value) && value >= limit && value <= Number.MAX_SAFE_INTEGER;
console.log(limit, limit === -(2 ** 53 - 1));
console.log(limit - 1 === limit - 2);
console.log(validAdjustment(limit), validAdjustment(limit - 1));
const descriptor = Object.getOwnPropertyDescriptor(Number, "MIN_SAFE_INTEGER");
console.log(descriptor.writable, descriptor.enumerable, descriptor.configurable);Result
-9007199254740991 true true true false false false false
Number.MIN_SAFE_INTEGER → signed-adjustment validation and the lower collision