MCPcopy Index your code
hub / github.com/Effect-TS/effect / number

Function number

packages/effect/src/Hash.ts:108–120  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

106 * @category hashing
107 */
108export const number = (n: number) => {
109 if (n !== n || n === Infinity) {
110 return 0
111 }
112 let h = n | 0
113 if (h !== n) {
114 h ^= n * 0xffffffff
115 }
116 while (n > 0xffffffff) {
117 h ^= n /= 0xffffffff
118 }
119 return optimize(h)
120}
121
122/**
123 * @since 2.0.0

Callers 3

arrayFunction · 0.70
hashFunction · 0.70
randomFunction · 0.70

Calls 1

optimizeFunction · 0.70

Tested by

no test coverage detected