|
|
In article <3b6de1fb@news.povray.org>,
"Vadim Sytnikov" <syt### [at] rucom> wrote:
> Using pow() in this context is a bad idea. Simple
> multiplication (e.g. len3*len3) will do the trick while
> being more efficient. Not by far due to the huge
> parsing overhead, but...
Actually, len3*len3 might be slower...more stuff to parse, and the time
it takes to call the C pow() function is insignificant compared to the
time it takes to parse POV code. But speed is very unlikely to be of any
concern here, readability is better, try this:
#macro Sqr(V) (V*V) #end
Sqr(Len3)
BTW, it is a good idea to always include at least one capital letter in
your macro or variable identifiers...what if some future version of POV
added len1, len2, or vangle() keywords? This code would simply fail.
--
Christopher James Huff - chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
<><
Post a reply to this message
|
|