![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_CLAMP opcode for value clamping in the VM. More...
Go to the source code of this file.
Functions | |
| if (x.type !=VAL_INT||lo.type !=VAL_INT||hi.type !=VAL_INT) | |
| if (v< lo.i) v | |
| if (v > hi.i) v | |
| push_value (vm, make_int(v)) | |
| free_value (x) | |
| free_value (lo) | |
| free_value (hi) | |
Variables | |
| case | OP_CLAMP |
| Value | lo = pop_value(vm) |
| Value | x = pop_value(vm) |
| int64_t | v = x.i |
| break | |
Implements the OP_CLAMP opcode for value clamping in the VM.
This file handles the OP_CLAMP instruction, which clamps a value between a minimum and maximum.
Behavior:
Error Handling:
Definition in file clamp.c.
| free_value | ( | hi | ) |
| free_value | ( | lo | ) |
| free_value | ( | x | ) |
| if | ( | v | , |
| hi. | i ) |