MCPcopy Index your code
hub / github.com/chain/Core / opAbs

Function opAbs

protocol/vm/numeric.go:85–101  ·  view source on GitHub ↗
(vm *virtualMachine)

Source from the content-addressed store, hash-verified

83}
84
85func opAbs(vm *virtualMachine) error {
86 err := vm.applyCost(2)
87 if err != nil {
88 return err
89 }
90 n, err := vm.popInt64(true)
91 if err != nil {
92 return err
93 }
94 if n == math.MinInt64 {
95 return ErrRange
96 }
97 if n < 0 {
98 n = -n
99 }
100 return vm.pushInt64(n, true)
101}
102
103func opNot(vm *virtualMachine) error {
104 err := vm.applyCost(2)

Callers

nothing calls this directly

Calls 3

applyCostMethod · 0.80
popInt64Method · 0.80
pushInt64Method · 0.80

Tested by

no test coverage detected