diff --git a/src/value.c b/src/value.c index a77570c0f4..029f411986 100644 --- a/src/value.c +++ b/src/value.c @@ -404,11 +404,10 @@ SIValue SIValue_Divide(const SIValue a, const SIValue b) { // Calculate a mod n for integer and floating-point inputs. SIValue SIValue_Modulo(const SIValue a, const SIValue n) { bool inputs_are_integers = SI_TYPE(a) & SI_TYPE(n) & T_INT64; - switch(inputs_are_integers) { - case true: + if(inputs_are_integers) { // The modulo machine instruction may be used if a and n are both integers. return SI_LongVal(a.longval % n.longval); - default: + } else { // Otherwise, use the library function fmod to calculate the modulo and return a double. return SI_DoubleVal(fmod(SI_GET_NUMERIC(a), SI_GET_NUMERIC(n))); }