Using Divw in Pyteal v6

divw requires the result to fit an uint64.

Since it is not yet available in TestNet/MainNet, but only in BetaNet, the documentation is only in the specs:

Regarding high/low for numerator, it’s to allow the numerator to have more than 64-bits.
For example, the number 10*2^64+42 = 184467440737095516202 would be defined as:

high = Int(10)
low = Int(42)

But honestly, if you need numbers with more than 64 bits, it is often much simpler to use the byteslice arithmetic:
https://pyteal.readthedocs.io/en/stable/arithmetic_expression.html#byteslice-arithmetic

1 Like