(val ref.Val)
| 737 | } |
| 738 | |
| 739 | func sqrt(val ref.Val) ref.Val { |
| 740 | switch v := val.(type) { |
| 741 | case types.Double: |
| 742 | return types.Double(math.Sqrt(float64(v))) |
| 743 | case types.Int: |
| 744 | return types.Double(math.Sqrt(float64(v))) |
| 745 | case types.Uint: |
| 746 | return types.Double(math.Sqrt(float64(v))) |
| 747 | default: |
| 748 | return types.NewErr("no such overload: sqrt") |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | func bitAndPairInt(first, second ref.Val) ref.Val { |
| 753 | l := first.(types.Int) |