MCPcopy
hub / github.com/vitest-dev/vitest / isNegativeNaN

Function isNegativeNaN

packages/utils/src/helpers.ts:344–354  ·  view source on GitHub ↗
(val: number)

Source from the content-addressed store, hash-verified

342}
343
344export function isNegativeNaN(val: number): boolean {
345 if (!Number.isNaN(val)) {
346 return false
347 }
348 const f64 = new Float64Array(1)
349 f64[0] = val
350 const u32 = new Uint32Array(f64.buffer)
351 const isNegative = u32[1] >>> 31 === 1
352
353 return isNegative
354}
355
356function toString(v: any) {
357 return Object.prototype.toString.call(v)

Callers 2

formatTitleFunction · 0.90
utils.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected