MCPcopy Create free account
hub / github.com/TanStack/ai / clamp01

Function clamp01

packages/ai-code-mode/models-eval/metrics.ts:169–173  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

167}
168
169function clamp01(value: number): number {
170 if (value < 0) return 0
171 if (value > 1) return 1
172 return value
173}
174
175function normalizeTenPoint(value: number): number {
176 return clamp01((value - 1) / 9)

Callers 3

normalizeTenPointFunction · 0.85
normalizeFivePointFunction · 0.85
failurePenaltyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected