POV-Ray : Newsgroups : povray.advanced-users : Max-value with function int() : Re: Max-value with function int() Server Time
29 Jul 2024 00:37:31 EDT (-0400)
  Re: Max-value with function int()  
From: Christopher James Huff
Date: 13 May 2003 23:06:19
Message: <cjameshuff-8D127F.23063713052003@netplex.aussie.org>
In article <3ec181ad@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Seemingly POV-Ray does an "(int)(x)" operation, when it should instead
> make a "floor(x)".

Not floor(), the int() operation is a bit different, which is why POV 
has both floor() and int() functions. floor() rounds to the next lower 
integer, but int() truncates the fractional part, effectively rounding 
towards 0. The standard C rint() function may be a better way to 
implement this.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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