mirror of
https://github.com/janet-lang/janet
synced 2025-07-03 18:42:54 +00:00
Formatting.
This commit is contained in:
parent
e38663c457
commit
026c64fa01
@ -1174,11 +1174,11 @@ JanetTable *janet_core_env(JanetTable *replacements) {
|
|||||||
"values."));
|
"values."));
|
||||||
templatize_varop(env, JANET_FUN_MODULO, "mod", 0, 1, JOP_MODULO,
|
templatize_varop(env, JANET_FUN_MODULO, "mod", 0, 1, JOP_MODULO,
|
||||||
JDOC("(mod & xs)\n\n"
|
JDOC("(mod & xs)\n\n"
|
||||||
"Returns the result of applying the modulo operator on the first value of xs with each remaining value. "
|
"Returns the result of applying the modulo operator on the first value of xs with each remaining value. "
|
||||||
"`(mod x 0)` is defined to be `x`."));
|
"`(mod x 0)` is defined to be `x`."));
|
||||||
templatize_varop(env, JANET_FUN_REMAINDER, "%", 0, 1, JOP_REMAINDER,
|
templatize_varop(env, JANET_FUN_REMAINDER, "%", 0, 1, JOP_REMAINDER,
|
||||||
JDOC("(% & xs)\n\n"
|
JDOC("(% & xs)\n\n"
|
||||||
"Returns the remainder of dividing the first value of xs by each remaining value."));
|
"Returns the remainder of dividing the first value of xs by each remaining value."));
|
||||||
templatize_varop(env, JANET_FUN_BAND, "band", -1, -1, JOP_BAND,
|
templatize_varop(env, JANET_FUN_BAND, "band", -1, -1, JOP_BAND,
|
||||||
JDOC("(band & xs)\n\n"
|
JDOC("(band & xs)\n\n"
|
||||||
"Returns the bit-wise and of all values in xs. Each x in xs must be an integer."));
|
"Returns the bit-wise and of all values in xs. Each x in xs must be an integer."));
|
||||||
|
@ -720,10 +720,10 @@ static JanetSignal run_vm(JanetFiber *fiber, Janet in) {
|
|||||||
double x1 = janet_unwrap_number(op1);
|
double x1 = janet_unwrap_number(op1);
|
||||||
double x2 = janet_unwrap_number(op2);
|
double x2 = janet_unwrap_number(op2);
|
||||||
if (x2 == 0) {
|
if (x2 == 0) {
|
||||||
stack[A] = janet_wrap_number(x1);
|
stack[A] = janet_wrap_number(x1);
|
||||||
} else {
|
} else {
|
||||||
double intres = x2 * floor(x1 / x2);
|
double intres = x2 * floor(x1 / x2);
|
||||||
stack[A] = janet_wrap_number(x1 - intres);
|
stack[A] = janet_wrap_number(x1 - intres);
|
||||||
}
|
}
|
||||||
vm_pcnext();
|
vm_pcnext();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user