MCPcopy Create free account
hub / github.com/expr-lang/expr / ToInt64

Function ToInt64

vm/runtime/runtime.go:354–383  ·  view source on GitHub ↗
(a any)

Source from the content-addressed store, hash-verified

352}
353
354func ToInt64(a any) int64 {
355 switch x := a.(type) {
356 case float32:
357 return int64(x)
358 case float64:
359 return int64(x)
360 case int:
361 return int64(x)
362 case int8:
363 return int64(x)
364 case int16:
365 return int64(x)
366 case int32:
367 return int64(x)
368 case int64:
369 return x
370 case uint:
371 return int64(x)
372 case uint8:
373 return int64(x)
374 case uint16:
375 return int64(x)
376 case uint32:
377 return int64(x)
378 case uint64:
379 return int64(x)
380 default:
381 panic(fmt.Sprintf("invalid operation: int64(%T)", x))
382 }
383}
384
385func ToFloat64(a any) float64 {
386 switch x := a.(type) {

Callers 1

RunMethod · 0.92

Calls 1

SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…