Forum Discussion
AMR_BEN_KHADRA
Jul 31, 2019Copper Contributor
MOD function
when I use MOD I face this result MOD(3,0.9)= 0.3 Great result MOD(3,0.2)= 0.2 Wrong result MOD(3,0.2) should be 0.00 this is by Identification and by the MS published syntax and as per GOOGLE ...
SergeiBaklan
Jul 31, 2019Diamond Contributor
That is due to floating point error (https://support.microsoft.com/en-us/help/78113/floating-point-arithmetic-may-give-inaccurate-results-in-excel). Using MOD with non-integer as second parameter is not reliable, better to use equivalent combination with INT or scale all numbers in MOD to integers.
AMR_BEN_KHADRA
Jul 31, 2019Copper Contributor
SergeiBaklanthank you, that is fair enough
- SergeiBaklanJul 31, 2019Diamond Contributor
AMR_BEN_KHADRA , you are welcome