POV-Ray : Newsgroups : povray.beta-test : error in SQRT : Re: error in SQRT Server Time
31 Jul 2024 08:20:11 EDT (-0400)
  Re: error in SQRT  
From: Thorsten Froehlich
Date: 6 Sep 2001 11:24:39
Message: <3b979537@news.povray.org>
In article <slr### [at] fwicom> , ron### [at] povrayorg (Ron
Parker) wrote:

>>But I tried to define a sqr macro as follows:
>>
>>#macro sqr(A)
>>A*A
>>#end
>>
>>and I got
>>
>>Parse Error: Expected 'undeclared identifier', sqr found instead.
>
> What if you define it as a function instead, since that's what you really
> want?

I would not recommend using a function for such a simple case.  It will work
for sure, but there is some overhead involved that (if used carelessly) can
slow down rendering of isosurfaces a lot.  The built-in operators should be
used whenever possible as they offer by far the best performance.


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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