POV-Ray : Newsgroups : povray.general : Random numbers and rounding : Re: Random numbers and rounding Server Time
3 Aug 2024 00:24:26 EDT (-0400)
  Re: Random numbers and rounding  
From: ABX
Date: 22 Jun 2004 14:46:12
Message: <gfvgd0ls77pnc48mj9dshmrfcouql4c9vb@4ax.com>
On Tue, 22 Jun 2004 14:22:07 -0400, "Slime" <fak### [at] emailaddress> wrote:
> > Is there any way to round a float to the nearest whole number.
>
> I'm not sure why there's no round() function, but here, this should work:
>
> #macro round(x)
> floor(x+0.5)
> #end

IMO

#declare round=function(x){floor(x+0.5)};

would be better.

ABX


Post a reply to this message

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