![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_LCM opcode for least common multiple. More...
Go to the source code of this file.
Functions | |
| if (!((va.type==VAL_INT)||(va.type==VAL_FLOAT))||!((vb.type==VAL_INT)||(vb.type==VAL_FLOAT))) | |
| if (a==INT64_MIN) | |
| while (y !=0) | |
| free_value (va) | |
| free_value (vb) | |
| push_value (vm, res) | |
Variables | |
| case | OP_LCM |
| Value | va = pop_value(vm) |
| int64_t | a = (va.type == VAL_INT) ? va.i : (int64_t)va.d |
| int64_t | b = (vb.type == VAL_INT) ? vb.i : (int64_t)vb.d |
| int64_t | x = a |
| int64_t | y = b |
| int64_t | g = x |
| int64_t | l = (a / g) * b |
| Value | res = make_int(l) |
| break | |
Implements the OP_LCM opcode for least common multiple.
Behavior:
Stack effect:
Types:
Definition in file lcm.c.
| free_value | ( | va | ) |

| free_value | ( | vb | ) |
| if | ( | ! | (va.type==VAL_INT)||(va.type==VAL_FLOAT))||!((vb.type==VAL_INT)||(vb.type==VAL_FLOAT) | ) |
| push_value | ( | vm | , |
| res | ) |
