MCPcopy Create free account
hub / github.com/cryptii/cryptii / isSafeInteger

Method isSafeInteger

src/Encoder/NumeralSystem.js:206–212  ·  view source on GitHub ↗

* Determines whether the provided value is a `Number` that is a safe integer. * @param {Number} testValue * @return {Boolean}

(testValue)

Source from the content-addressed store, hash-verified

204 * @return {Boolean}
205 */
206 static isSafeInteger (testValue) {
207 if (Number.isSafeInteger === undefined) {
208 const maxInteger = Number.MAX_SAFE_INTEGER || 9007199254740991
209 return Number.isInteger(testValue) && Math.abs(testValue) <= maxInteger
210 }
211 return Number.isSafeInteger(testValue)
212 }
213
214 /**
215 * Translates given decimal to roman numerals.

Callers 1

decodeNumberMethod · 0.80

Calls 1

isIntegerMethod · 0.80

Tested by

no test coverage detected