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

Function ToFloat64

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

Source from the content-addressed store, hash-verified

383}
384
385func ToFloat64(a any) float64 {
386 switch x := a.(type) {
387 case float32:
388 return float64(x)
389 case float64:
390 return x
391 case int:
392 return float64(x)
393 case int8:
394 return float64(x)
395 case int16:
396 return float64(x)
397 case int32:
398 return float64(x)
399 case int64:
400 return float64(x)
401 case uint:
402 return float64(x)
403 case uint8:
404 return float64(x)
405 case uint16:
406 return float64(x)
407 case uint32:
408 return float64(x)
409 case uint64:
410 return float64(x)
411 default:
412 panic(fmt.Sprintf("invalid operation: float(%T)", x))
413 }
414}
415
416func ToBool(a any) bool {
417 if a == nil {

Callers 2

RunMethod · 0.92
ExponentFunction · 0.85

Calls 1

SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…