The % operator doesn't work on floating-point values. You'll have to use a function to calculate what you want. Here's the basic pseudocode of what it would look like:
B % A = B - (floor(B / A) * A)
There are also library functions which will do this for you in math.h or tgmath.h
Also, you can use: fmod() or fmodf() from .