I agree.Josef Templ wrote:Mod1 has the advantage that it documents pretty well what it does.[
I disagree with the reasoning, but agree with the conclusion - which is probably what matters.In C libraries the function "fmod()" is quite common for floating point
modulo operations. And our function is exactly fmod(x, 1).
To me a good reason is that it closely resembles the Component Pascal function "x MOD 1".
Doug - do you really want to continue this discussion? I would rather keep it short.
Look at http://mathworld.wolfram.com/FractionalPart.html for a typical neutral discussion of this area. Both functions are widely recognised,
but there are not commonly agreed dual names; "Frac" is widely used for both. To provide both functions we need to invent a new name, which is undesirable.
Josef's suggestion is clever because he has avoided that by reusing, without misusing, an existing name.
---
Just to clarify: When I say I disagree with the reasoning I do not mean to imply it is wrong, merely that it does not convince me to support the conclusion.
Personally I don't care what a particular C library does.