/**
* Returns the largest positive value that can be stored
* in a signed 64-bit integer.
*
* A signed 64-bit integer uses:
* - 1 bit for the sign
* - 63 bits for the value
*
* Maximum value = 2^63 - 1
*
* @returns {bigint}
*/
function getMaxInt64() {
return (1n << 63n) - 1n;
}
// Example usage
const maxValue = getMaxInt64();
console.log(`Maximum Int64 value: ${maxValue}`);
/*
run:
Maximum Int64 value: 9223372036854775807
*/