POV-Ray : Newsgroups : povray.newusers : rounding : Re: rounding Server Time
28 Jul 2024 16:22:26 EDT (-0400)
  Re: rounding  
From: Slime
Date: 25 Jun 2008 22:59:38
Message: <4863061a$1@news.povray.org>
> floor(A) Floor of A. Returns the largest integer less than A. Rounds
> down to the next lower integer.
>
> And you can use A - int(A) to see if the fractional part is > 0.5

Or just

floor( A + 0.5 )

(Although this will cause -3.5 to be rounded to -3, which I'm not sure is 
correct.)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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