![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_TO_NUMBER opcode for converting values to integers in the VM. More...
Go to the source code of this file.
Functions | |
| if (v.type==VAL_INT) | |
| push_value (vm, make_int(0)) | |
Variables | |
| case | OP_TO_NUMBER |
| else | |
| break | |
Implements the OP_TO_NUMBER opcode for converting values to integers in the VM.
This file handles the OP_TO_NUMBER instruction, which converts a value to an integer. The value is popped from the stack, and the result is pushed back.
Behavior:
Error Handling:
Example: // Bytecode: OP_TO_NUMBER // Stack before: ["42"] // Stack after: [42]
Definition in file to_number.c.
| if | ( | v. | type = = VAL_INT | ) |
| push_value | ( | vm | , |
| make_int(0) | ) |

| break |
Definition at line 94 of file to_number.c.
| else |
Definition at line 90 of file to_number.c.
| case OP_TO_NUMBER |
Definition at line 34 of file to_number.c.