how to modulo decimal c

C
#include <math.h>

int main(void)
{
	// use the fmod() function
 	printf("%f", fmod(0.5, 2.0));
}
Source

Also in C: