Posted to tcl by miguel at Tue Apr 29 19:52:08 GMT 2008view raw
- long lRemainder, lQuotient = l1 / l2;
- /*
- * Force Tcl's integer division rules.
- * TODO: examine for logic simplification
- */
- if ((lQuotient < 0 || (lQuotient == 0 &&
- ((l1 < 0 && l2 > 0) || (l1 > 0 && l2 < 0)))) &&
- (lQuotient * l2 != l1)) {
- lQuotient -= 1;
- }
- lRemainder = l1 - l2*lQuotient;