So I heard you can't use the modulus operator with floats. You need to use fmod. So my question is, why didn't they just make the operator do that? Is there some technical reason behind it or something?
Printable View
So I heard you can't use the modulus operator with floats. You need to use fmod. So my question is, why didn't they just make the operator do that? Is there some technical reason behind it or something?
Perhaps because mod is usually the remainder after division, but in floating point there never is any remainder with division.
Or maybe you'd just have to ask the language inventors.