MCPcopy Create free account
hub / github.com/CPChain/chain / opDiv

Function opDiv

core/vm/instructions.go:65–74  ·  view source on GitHub ↗
(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack)

Source from the content-addressed store, hash-verified

63}
64
65func opDiv(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
66 x, y := stack.pop(), stack.peek()
67 if y.Sign() != 0 {
68 math.U256(y.Div(x, y))
69 } else {
70 y.SetUint64(0)
71 }
72 evm.interpreter.intPool.put(x)
73 return nil, nil
74}
75
76func opSdiv(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
77 x, y := math.S256(stack.pop()), math.S256(stack.pop())

Callers

nothing calls this directly

Calls 4

popMethod · 0.80
peekMethod · 0.45
SignMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected