The Javascript Googolplex Equation

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

The Javascript Googolplex Equation

Post by JellyFish »

As the title hints, I'm looking for the Javascript Googolplex Equation!!! :D

If anyone has figured it out yet, post. Anyone has any Idea's on somewhere to start is good to.

Now I don't know much of what I'm doing :P e.g. I'm not serious about this, but I'm sure there's a way to give a variable the value of The GOOGOLPLEX. Bahha!

Edit: I know this is kinda stupid but, why doesn't "^" in Javascript mean what it means in Math?
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

Sweeaat! I found the Math method: pow(). I tried it out to get the value of googolplex and it returned "infinite"!!! I mean???

I tried just the googol i.e. 10^100. and it returns something like 1e+100 or something. Like how hard is it to write 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000??? How could I get this value from the pow method?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

^ is a bitwise operator XOR. It's the same in PHP and other languages ;)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

You might also want to look into either:

a. Porting an existing Big/Large Integer library over to Javascript
- http://www.koders.com/cpp/fid6BFB93B68C ... biginteger
b. Using an existing third party BI library
- http://www-cs-students.stanford.edu/~tjw/jsbn/

Here are some more links on the subject, search google and I'm sure you'll find more ;)

http://www.math.umbc.edu/~campbell/Numb ... ogramming/

HTH

Cheers :)
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

I don't understand. "Porting an existing Big/Large Integer library over to Javascript." what does that mean?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

JellyFish wrote:I don't understand. "Porting an existing Big/Large Integer library over to Javascript." what does that mean?
Computers are usually 32 bit. These days there are lots of 64 bit computers but either way; the Googol exceeds 32 bits so computers cannot physically compute it by themselves. This is the same cause as the unix epoch problem. Large bit size libraries do some magical things with stacks to run calculations rather than performing actual binary operations.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

I see. What does it mean 32bit? What part of the computer is this usually talking about? A link to an artical on this that explains everything about this would be appropiete.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

JellyFish wrote:I see. What does it mean 32bit? What part of the computer is this usually talking about? A link to an artical on this that explains everything about this would be appropiete.
The bit that does all the processing is the CPU. CPUs come (mostly) in 32 bit or 64 bit.

http://en.wikipedia.org/wiki/Integer_(computer_science)
Post Reply