Sun Studio 12: C User's Guide

(7.5.6.4) Whether a domain error occurs or zero is returned when the fmod function has a second argument of zero:

In this case, it returns the first argument with domain error.