HI D and thank you for your comprehensive answer.
So why do i get +2500 for
System.Math.IEEERemainder(12500, 5000);
maybe i need to read about the rounding convention.
12500/5000 --->2,5
2,5 should round up to 3 (if i do understand the rouning up convention)
meaning 12500 -(5000* 3) = -2500?
the result is 2500 instead of the expected -2500 according to rounding up
convention.
Thanks
JJ
"David Musgrove" <Da***********@discussions.microsoft.comskrev i en
meddelelse news:A2**********************************@microsof t.com...
The IEEE remainder is defined as:
x - (y Q)
where here x = 7500, y = 5000 and Q = 7500 / 5000 *rounded to the nearest
integer*. In other words, here Q = 2 (by convention, 1.5 is rounded up to
2)
and so the IEEE remainder comes out negative. Basically, the remainder
will
be as close to 0 as possible, and in the case where positive and negative
remainders are equally close to 0, the negative is chosen simply by the
definition of the function.
Hope that makes some sense at least. :)
D