To do modulus arithmetic with doubles and floats use the math.h library.
Use the following functions:
double fmod(double x, double y);
float fmodf(float x, float y);
long double fmodl(long double x, long double y);
Use -lm to link to the library.
double fmod(double x, double y);
float fmodf(float x, float y);
long double fmodl(long double x, long double y);
No comments:
Post a Comment