POV-Ray : Newsgroups : povray.advanced-users : Negative division : Re: Negative division Server Time
29 Jul 2024 02:21:58 EDT (-0400)
  Re: Negative division  
From: Thorsten Froehlich
Date: 10 Mar 2003 08:23:32
Message: <3e6c91d4@news.povray.org>
In article <3e6bcf10@news.povray.org> , "Anders K." <and### [at] kaseorgcom> 
wrote:

> This has annoyed me a lot. If they fixed the broken gradient pattern, why
> can't they fix the equally broken div() and mod() functions?

Because they are not broken.  This is the correct and thus expected
behavior.

> div(7, 3) = 2
> div(-7, 3) = -3
> div(7, -3) = -2
> div(-7, -3) = 3

How can the result possibly be +-3 for any of these?  No matter how you
round, this makes only sense if you apply *different* rounding rules
depending on the signs.  And doing so is nonsensical.

> mod(7, 3) = 1
> mod(-7, 3) = 2
> mod(7, -3) = 1
> mod(-7, -3) = 2

Again, only if you apply random rules you could arrive at this result.  I
could understand you argue for 1,2,2,1 as results for this, but not 1,2,1,2
because that is definitely wrong.

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.