From e5ab23383dbcd2ff72066cb469f24c8b42433c92 Mon Sep 17 00:00:00 2001 From: Roi Lipman Date: Mon, 11 May 2020 09:47:53 +0300 Subject: [PATCH] Update value.c removed.boolean switch --- src/value.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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))); }