# [PD] fib verb - was converting decimal to binary

Mathieu Bouchard matju at artengine.ca
Tue Jul 11 20:06:09 CEST 2006

```On Fri, 7 Jul 2006, padawan12 wrote:
> Mathieu Bouchard wrote:
>> This is because if a is the golden section and b=-1/a, then:
>>    Fib(n) = (a^n - b^n)/(a-b)
>> so:
>>    Fib(n+1)/Fib(n) = (a^(n+1) - b^(n+1))/(a^n - b^n)
>
> I found a closed ofrm of fib which goes
> fib(n) = (phi^n - (1-phi)^n)/sqrt(5)

That's the same, cause a=phi, b=-1/a=1-a, a-b=sqrt(5)

> It seems to be with the second numerator term, the Pd [pow] doesn't like
> non integer negatives.

It's not well-defined to compute a negative number to a non-integer
power. "Not well-defined" means that there are several possible answers,
or no answer, or even both (depending on the way of looking at it).

(1-phi)^n for even n is a positive value.

(1-phi)^n for  odd n is a negative value.

(1-phi)^n for noninteger n would be a value for which the sign is
unknown, but for which you know the absolute value. In another
way, it can be argued that it should be a complex number, and in yet
another way it can be argued that it can be a set of complex numbers.

If any other object actually gives an answer for that, I can't guarantee
that your results will make sense.

_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada
```

More information about the Pd-list mailing list