modulo

xod/core/modulo

Computes the remainder of `IN1` divided by `IN2`.
modulo
@/modulo
Computes the remainder of `IN1` divided by `IN2`.
IN1number
Numerator
IN2number
Denumerator
modulo
IN1
IN2
OUT
OUTnumber
The remainder rounded towards zero

C++ implementation

#pragma XOD dirtieness disable

node {
    void evaluate(Context ctx) {
        Number in1 = getValue<input_IN1>(ctx);
        Number in2 = getValue<input_IN2>(ctx);
        Number out = fmod(in1, in2);
        emitValue<output_OUT>(ctx, out);
    }
}

Tabular tests

IN1IN2OUT
13103
4104
-610-6
-2610-6
-26-10-6
26-106
735.252.331.29~
NaN10NaN
26NaNNaN
InfInfNaN
-InfInfNaN
Inf-InfNaN