|
![](/i/fill.gif) |
"makc" <mak### [at] gmail spam com> wrote:
> Hello all, could you please advice on following problem. For example, I have two
> functions
>
> #declare frac = function (x) {
> x - floor (x)
> }
>
> #declare menger = function (x, order) {
> floor (3*frac(x*pow(3,order))) - floor (3*frac(x*pow(3,order))/2)*2
> }
....
> But how do I explain this to pov?
>
> Ok, in this particular case I could use intermediate function
>
> #declare menger2 = function (tmp) {
> floor (3*tmp) - floor (3*tmp/2)*2
> }
>
> #declare menger = function (x, order) {
> menger2(frac(x*pow(3,order)))
> }
>
> but
>
> 1) not sure if this can be done for arbitrary combination
Neither do I.
I can't remember having seen a function where this way of doing it is
not possible.
But if you or anyone else can come up with a good challenge, then
please post it.
> 2) wont stacking functions like that actually slow things down
I have mostly experienced speed-ups.
But sometimes extra functions calls is not worth simple recalculations.
--
Tor Olav
http://subcube.com
Post a reply to this message
|
![](/i/fill.gif) |