Hi
I'm trying to use:
float divAm = (float)theAngle%(float)rads;
but its saying that Invalid operands to binary %
theAngle and rads are both of type float.
Any suggestions please?
Thanks
Hi
I'm trying to use:
float divAm = (float)theAngle%(float)rads;
but its saying that Invalid operands to binary %
theAngle and rads are both of type float.
Any suggestions please?
Thanks
Hi Lily,
The modulus operator is a binary integer operator - it cannot be used with floats. You should use fmod() instead:-
float fmod( float numerator, float denominator );
It's defined in math.h. There is also a version using doubles if you need that.