I was wondering if the Golden ratio base (phinary system) has any use somewhere and if arithmetics with it is easy?(adsbygoogle = window.adsbygoogle || []).push({});

I programmed a surprisingly simple algorithm to calculate the logarithm yielding digits in base phi using nothing more than 2 multiplications/divisions per result digit. Can it be useful?

Here the python programm if you want to see:

Code (Text):

phi=(sqrt(5)+1)/2

base=2

digits=5

totalDigits=30

a0,b0=1/base**(phi**digits),base**(phi**(digits-1))

def logPhinary(x):

a,b=a0,b0

result=""

x*=a

switch=0

for i in range(totalDigits):

if switch==0:

a*=b

if x > 1:

result+="1"

b*=a

x*=a

else:

switch=1

x/=a

else:

b*=a

if x > 1:

result+="1"

a*=b

x/=b

else:

switch=0

x*=b

result+="0"

return result[0:digits+1]+"."+result[digits+1:] #insert decimal point

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Golden ratio base useful? Easy logarithm in phinary system

**Physics Forums | Science Articles, Homework Help, Discussion**