MCPcopy Create free account
hub / github.com/InferCore/InferCore / toInt

Function toInt

internal/policy/basic_engine.go:156–167  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

154}
155
156func toInt(v any) (int, bool) {
157 switch t := v.(type) {
158 case float64:
159 return int(t), true
160 case int:
161 return t, true
162 case int64:
163 return int(t), true
164 default:
165 return 0, false
166 }
167}
168
169func toFloat(v any) (float64, bool) {
170 switch t := v.(type) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected