J
Jason Froese
I have run across the problem that MOD rounds down
negative numbers to get the results due to the use of the
INT function
E.G. MOD ( -9,5 ) returns 1 ( -2 remainder 1 )
i was just wondering why the function used to calculate
mod in excel
"MOD (n, d) - n - d * INT ( n/d )"
doesn't just use TRUNC instead of INT
"MOD (n, d) - n - d * TRUNC ( n/d )"
I was taught in elementary school that 9 / 5 = 1.8 (1
remainder 4 )
and 9 / -5 = -1.8 ( -1 remainder 4 (9 - (-5*-1) )
not -2 remainder 1
negative numbers to get the results due to the use of the
INT function
E.G. MOD ( -9,5 ) returns 1 ( -2 remainder 1 )
i was just wondering why the function used to calculate
mod in excel
"MOD (n, d) - n - d * INT ( n/d )"
doesn't just use TRUNC instead of INT
"MOD (n, d) - n - d * TRUNC ( n/d )"
I was taught in elementary school that 9 / 5 = 1.8 (1
remainder 4 )
and 9 / -5 = -1.8 ( -1 remainder 4 (9 - (-5*-1) )
not -2 remainder 1