POV-Ray : Newsgroups : povray.newusers : rounding : Re: rounding Server Time
28 Jul 2024 22:29:40 EDT (-0400)
  Re: rounding  
From: andrel
Date: 28 Jun 2008 15:07:33
Message: <48668C29.90908@hotmail.com>
Warp wrote:
> Slime <fak### [at] emailaddress> wrote:
>> floor( A + 0.5 )
> 
>> (Although this will cause -3.5 to be rounded to -3, which I'm not sure is 
>> correct.)

you could use ceil(A-0.5) in that case or even use a switch for >0 and <0
> 
>   Why would rounding it to -4 be more correct? 3.5 is equally close to
> either value.
> 
depends on convention. There as thus 4 ways to round halves: 
up,down,towards zero and away from zero.


Post a reply to this message

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