|
![](/i/fill.gif) |
Greg M. Johnson nous apporta ses lumieres en ce 2005-11-11 21:39:
> Greg M. Johnson wrote:
>
>
> Oi vey! Too much late-night coding, I guess. :-S
>
> Yes, that's an abs() function. I wanted a sign() function and so was
> writing my own.
>
> Perhaps it was late-night delusions, but I did think that povray 3.5 (the
> apt-get version) was freaking with me when it came to nested function/macro
> calls.
>
>
>
>>I cannot get the following code to work:
>>
>>//-----------------------------
>>#macro sign(a)
>>#if (a<0)
>> (-a)
>>#else
>> (a)
>>#end
>>#end
a sign() function return 1 if >0, -1 if <0 and 0 if =0.
It should look like:
#macro sign(a)
#if(a<0) #local S=-1;
#else #if(a>0) #local S=1;
#else #local S=0;
#end
#end
(S) // return the result
#end
--
Alain
-------------------------------------------------
After any salary raise, you will have less money at the end of the month than you did
before.
Post a reply to this message
|
![](/i/fill.gif) |