I have basic doubt.I have to convert float minutes =( (10.09/60 ) % 60);
but error is invalid to binary expression(double to double).
how can I make this calculation easy..
What I am trying is firstly
float minutes =( (10.09/60 )
then trying to convert minutes into NSInterger to solve module (%) operation..
but how can I do this…or else suggest other solution to get this calculation..
float minutes =( (10.09/60 ) % 60);
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 .