addition/number limit
Mar 28, 2011 at 12:27am
addition/number limitHello I have made a little patch to generate a Fibonacci sequence (with help from a two year old thread on the forum about how to set this up) and then map the given numbers to chromatic pitches constrained to one octave (011). I’m making a standalone app as a friend who is a composer. Anyway I have noticed that after about 45 or so iterations of creating the next number in the series after 1,836,311,903 Max starts going into negative numbers and acting weird. Similar results are obtained by multiplication as well. Is there a size limit for working with raw numbers in Max? Probably a really basic question that I should know the answer to by now… Sorry for the long post. Thanks very much. B 

Mar 28, 2011 at 4:02am
The range of a 32bit integer is −2,147,483,648 to 2,147,483,647. If you really need Fibonacci numbers beyond 1,836,311,903, see fibonacci.java in the Max java examples. 

Mar 28, 2011 at 4:16am
also if you’re just going for successive ratios (getting closer and closer to the golden ratio) you can just set a reallyaccurate float representation, then use it one place more accurate at a time, so 1.6 etc. Then whatever you want to do with it should in theory be possible, using floats, though of course I don’t know exactly what you’re doing with the numbers. I think you can also munge two 32bit numbers to get a 64bit one with a few tricks, though I don’t recall the exact steps. Sounds interesting though, I love this stuff… 

Mar 28, 2011 at 10:27am
Note that 32bits is not a specifically Max limitation. It is a limitation of 32bit integers (sorry about the tautology, but no way around it), which was the largest size register most commercially available computers could offer until very recently. Even with 64bit registers you’re going to run out of bits very quickly when calculating Fibonacci numbers (or any other series with exponential growth). If you want arbitrarily large integer precision, you’ll need to use something like Mathematica 

Mar 28, 2011 at 12:15pm
after i´ve written a fibonacci abstraction i´ve never used it again because it 

Mar 28, 2011 at 5:13pm
Thanks for all the replies! Very educational indeed. I do appreciate it. B 
You must be logged in to reply to this topic.