#include <math.h> and use fmod.