Infinite precision - All operations

MisterX b.xavier at internet.lu
Wed May 25 14:21:00 EDT 2005


Hi infinity seekers...

dont be scared, it's just an education stack but for higher education... I
hope you learn something about it, that's all. It's been some 10 years since
i stopped doing this stuff in my head and gave up looking for this kind of
solution but here is in an innofensive stack ;)

I made a stack that does all 4 "infinite" type operations... Note i kind of
cheated on the divide but it's for simplicity of the purpose. I'll add a
real numeric modulator codec later from my own personal compression theory.
There's tons of room for improvements  and complex buttons...

It works with the powerseries theorem on Tailor series. 

http://mathworld.wolfram.com/PowerSeries.html

But i got a problem resolving an infinite loop in the recursive addition
(not a new function but i just rewrote it for this purpose in a dull moment
at work) in this quick little calculator i tried to do this morning for
infinite sizes - we do have petabytes of backups at work and i couldn't
calculate the size! What do i tell my manager now? ;)

Where do i substract what or where did i miss that zero condition? Problem
being that using the builtin "add" operator limits the outcome of all 4
operators... 2 solutions: recurse=easy or work on the pure base notation
which implies bitshifters which we dont have native in Rev. 

a third solution is to virtualize the sizes where B1^z = B1^(a/z)
IOW's (please excuse my math language) 100000 = 1e5 in exponential notation
and this works nicely in base 10 with zeros added or removed... quite an
advantage to most other bases - remember, using just one base is "not" the
most efficient way to interpret the universe - but as a semantical unit,
base 10 has an advantage... 

Those who want to tackle the challenge can do so here

go url "http://monsieurx.com/hyper/Challenges/PowerOps.mc"

The functions are in the stack's script for later plugin modes...

It's a slate calculator with 3 rows of 2 numbers, a row of buttons to
operater your calculator, and the result field. Each number row is made a
base and a number field (but no modulator yet for decimal to hex (or base
b<runrevINF) notation - i got that in the library to pick later - i've
overloaded my RAM already today ;). The bases should be working but it's
majorly flawed in the "add" recursion because it recurses infinitely adding
the same two bases each time ;). 

Just a minor glitch ;) If you use the runrev "add" instead, it works but not
for very long numbers (base regardless)... So do all the other functions
Subtract, Multiply and divide. There's a number generator too for those too
lazy to type a number ;)

Using the rev "add" function, if you add 1 to number1 being a big number,
and the result is not equal to number1 field+1 then you have a limit... 

You can play with this stack now, i'll add a GUI to it later aligator. See
the story's comments for release news when it comes. Any Fix is seriously
welcome but i'll try to figure this out anyway before announcing it
"officially" ;)

Im pasting a GUI in no time, but writing the help is gonna be a bit time
consuming with the formulas and the nice weather out there and the friends
who joined the GTR club that i got to beat (trainingX10^100000). 

In the least, this stack will explain in simple english how numbers actually
work which is the basics for Natural Math - the science of numbers in
mathematics exponents, bases and logarithms! 

Oh yes, before you say it, there's no decimal precision (use your head's
virtual comma)... Integers only (when did you see a fraction of an atom
somewhere in the universe lately?) and there's no checking for number
integrity - IOW, use the generator - it will generate per-base symbols later
along with user-error prevention ;)...

Matrices? Yes... But at their simplest to keep it easy. I tried to rely on
basic math operators with the smallest integer values so that limits of
what's possible are extended without the 3rd trick implemented. 

This version only works with base 10 but the code should do other bases but
deliver a base 10 sum number - not a modulo-adjusted base notation
expression. no e^max detection (inf). Then it gets complicated but it's as
simple as baseconvert(number,base) without the limits ;)

There an infinite way to handle this - believe me - in the process i found a
cool cellular automata that could do this (i have to program it yet out of
my brain - another story based on the division function).

 So it's as simple as possible - formula to script, no quest for
optimization - just a quest for big numbers... And I got a prime candidate
to test - alas there's no GIMP to solve this series! If runrev makes it
where Mathematica didn't, that's good for our excellent community ;)

Yes, binary shifting would be simpler and faster in an external - but you're
have to convert numbers too from base 1 to base 2 so if this works, there's
no reason why it wont in another language and in principle within Rev to
show how it works! Why complicate things?

PS: the reason why power series is by far the best way to tackle this IMOHO
is because it applies also to any calculus or calculus depending derivative
(stats (finance, econometrics), physics (electronics), etc...)

sorry to have kept you! Nature is quite something, and numbers are an
integral of it's aproximation which need exponential relative sizing... This
is what this does... 

Next feature:
put powerDo(255^255^255)

cheers
Xavier
http://monsieurx.com



More information about the use-livecode mailing list