|
![](/i/fill.gif) |
Ard wrote:
> POV's mod(-3, 10) returns -3. I don't have a problem with the
> documentation: mod() works as described, returning ((A/B)-int(A/B))*B where
> int(A) is not further from 0 than A on a number line.
>
> However I do think that POV's mod() should behave like Perl's, and with
> common (I thought) practice, where mod(A,B) lies in the range [0,B) for all
> positive B.
>
> Compare the gradient pattern: it used to be mirrored about 0, but post-3.5,
> it is a continuous saw-tooth. This new behaviour is what I expect from
> mod().
>
> Behaviour for B<0 seems to be debated but for the far more common case of
> B>0, I believe mod(A,B) should be >= 0 for all A.
>
> I'm sure the mathematicians in the audience will have their own references,
> but here is another: http://en.wikipedia.org/wiki/Modulo_arithmetic
>
> Anybody agree? Anybody care?
POV-Ray follows what the ISO standards for C and C++ use as mod.
Thorsten
Post a reply to this message
|
![](/i/fill.gif) |