% is for int or long, not float or double.
You can use fmod() or fmodf() from <math.h> instead.
Better is <tgmath.h> as suggested by the inventor of CGFloat.
If I remember correctly modulo requires 2 ints as its input so you'd need something like:
CGFloat moduloResult = (float)((int)valueB % (int)valueA);
Assuming that valueB and valueA are both floats
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With