(a any)
| 383 | } |
| 384 | |
| 385 | func 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 | |
| 416 | func ToBool(a any) bool { |
| 417 | if a == nil { |