|
![](/i/fill.gif) |
In article <3ec23a4f@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> Rounding would change its behaviour, which might not be good (eg. int(0.6)
> would now give 1 instead of 0).
>
> If the different behaviour of floor() with regard to negative values is
> a problem, then the solution is easy: x<0 ? -floor(-x) : floor(x)
You're right, rint() doesn't do what I thought it did. Your expression
should do the right thing without stomping on the precision. Perhaps
adding a separate round() or rint() built-in function would be useful as
well.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |