OP_WITHIN

(165 | 0xa5)

Input

3 items

|

Output

1 items

OP_WITHIN is used to verify whether a given number falls within a certain range. It takes three values from the stack: x, min, and max, and checks whether min <= x < max. If x is within this range, the opcode pushes true (1) onto the stack; otherwise, it pushes false (0). This operation is useful in scripts that need to validate whether an input meets specific numerical conditions.

OP_Code Walkthrough

Checks if the third item of the stack is within the top two items.

Pop Top Item (max)

Pop Next Top Item (min)

Pop Next Top Item (x)

Check Range

Push result