Skip to content

divw and friends #1967

Closed
Closed
@jannotti

Description

TEAL has addw and mulw but divw is lacking. It's quite hard to implement "long" division properly with the remaining operations in TEAL. Some possibilities

divw: takes two 128 uints, in the form of two pairs of uint64s on the stack. pushes the quotient as two uints. cost ~ 4?
modw: same, but gives remainder. cost ~ 4?
divmodw: returns both, at lower cost than 8?

Is there a need for subw? I think less so because "long" subtraction is more easily implemented with the rest of TEAL.

Also add the following opcodes: shl, shr, exp, expw, sqrt, log2

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions