I'm trying to find the modulus of two floating point numbers. I should be able to use fmodf, but I'm getting seemingly random values when I pass it the numerator as a variable.
returns 3.000000, which is correct, butCode:alpha = fmodf(31, 7);
returns 6.000000, which makes no sense.Code:float theta_demand = 31; alpha = fmodf(theta_demand, 7);
Anyone had this problem before?