MCPcopy Index your code
hub / github.com/Shopify/go-lua / arith

Method arith

vm.go:9–20  ·  view source on GitHub ↗
(rb, rc value, op tm)

Source from the content-addressed store, hash-verified

7)
8
9func (l *State) arith(rb, rc value, op tm) value {
10 if b, ok := l.toNumber(rb); ok {
11 if c, ok := l.toNumber(rc); ok {
12 return arith(Operator(op-tmAdd)+OpAdd, b, c)
13 }
14 }
15 if result, ok := l.callBinaryTagMethod(rb, rc, op); ok {
16 return result
17 }
18 l.arithError(rb, rc)
19 return nil
20}
21
22func (l *State) tableAt(t value, key value) value {
23 for loop := 0; loop < maxTagLoop; loop++ {

Callers 3

ArithMethod · 0.95
executeSwitchMethod · 0.95
initFunction · 0.80

Calls 5

toNumberMethod · 0.95
callBinaryTagMethodMethod · 0.95
arithErrorMethod · 0.95
arithFunction · 0.85
OperatorTypeAlias · 0.85

Tested by

no test coverage detected