Sun WorkShop Compiler C 5.0 User's Guide

(6.3.5)The sign of the remainder on integer division:

The result is the same sign as the dividend; thus, the remainder of -23/4 is -3.