C implementation of a modulo function

It's an easy piece of code but handy to have it around off the shelf:

modulo.c
int modulo(int *values, int numberOfValues, int modulo)
{
    for (int i = 0; i < numberOfValues; i++)
    {
        while(values[i] > modulo/2 || values[i] < modulo/2)
        {
            (values[i] > modulo/2) ? values[i] -= modulo : values[i] += modulo;
        }
    }
}