![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_DIV opcode (numeric division) in the VM. More...

Go to the source code of this file.
Functions | |
| if ((a.type==VAL_INT||a.type==VAL_FLOAT) &&(b.type==VAL_INT||b.type==VAL_FLOAT)) | |
| exit (1) | |
Variables | |
| case | OP_DIV |
| Value | a = pop_value(vm) |
| else | |
| break | |
Implements the OP_DIV opcode (numeric division) in the VM.
Handles the OP_DIV instruction, dividing two numeric operands and pushing the result. If either operand is a float, division is performed in double precision and a VAL_FLOAT is produced; otherwise integer division is used and a VAL_INT is produced.
Behavior:
Error Handling:
Example: // Bytecode: OP_DIV // Stack before: [10, 2] // Stack after: [5] // Stack before: [5.0, 2] // Stack after: [2.5]
Definition in file div.c.
| exit | ( | 1 | ) |
| else |