POV-Ray : Newsgroups : povray.advanced-users : Negative division : Re: Negative division Server Time
29 Jul 2024 02:23:41 EDT (-0400)
  Re: Negative division  
From: Anders K 
Date: 9 Mar 2003 18:32:32
Message: <3e6bcf10@news.povray.org>
Andrew Coppin wrote:
> What do div() and mod() do in the case of negative numerator/denominator?

POV-Ray's answers are:

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

whereas the correct answers are:

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

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?

Anders


Post a reply to this message

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