The result of fmod
is always exact; whether y
is an integer is irrelevant. Of course, if x
and/or y
are already approximations of some real numbers a
and b
, then fmod(x,y)
is unlikely to be exactly equal to a mod b
.
More Related Contents:
- error: incompatible types for a function that returns float in C
- Why does >= operator work as > operator in C when compared with 0.9 [duplicate]
- How do I restrict a float value to only two places after the decimal point in C?
- Correct format specifier for double in printf
- Dividing 1/n always returns 0.0 [duplicate]
- How to get the sign, mantissa and exponent of a floating point number
- How to compare double numbers?
- What operations and functions on +0.0 and -0.0 give different arithmetic results?
- Simd matmul program gives different numerical results
- Floating point comparison `a != 0.7` [duplicate]
- Representing integers in doubles
- C: Casting minimum 32-bit integer (-2147483648) to float gives positive number (2147483648.0)
- Are floating point operations in C associative?
- Comparing floating point numbers in C
- Comparing float and double in C
- Is it safe to assume floating point is represented using IEEE754 floats in C?
- Count number of digits after `.` in floating point numbers?
- Is there a tool to know whether a value has an exact binary representation as a floating point variable?
- problems in floating point comparison [duplicate]
- Is my fma() broken?
- Encoding int value as an IEEE-754 float (binary32)
- C – Serialization of the floating point numbers (floats, doubles)
- Variadic function (va_arg) doesn’t work with float?
- Why does printf print random value with float and integer format specifier
- Trouble with float on C [duplicate]
- When does underflow occur?
- C printf using %d and %f
- Comparing float and double
- C Function to Convert float to byte array
- pow() cast to integer, unexpected result