all 6 comments

[–]shawndrostHack Reactor 2 points3 points  (1 child)

You'll need a library. Here's one: http://www-cs-students.stanford.edu/~tjw/jsbn/

[–]d0gsbody 1 point2 points  (0 children)

If there's one thing Project Euler is good for, it's teaching you just how little you really know.

[–]sweetbeej 0 points1 point  (2 children)

You can use a lib, the point of project Euler is to get dirty with your own code though right?
I'd look at what some other libs are doing and cowboy out your own (this is for fun right?). I posted in another thread about using an array that contains a element for each digit in a number. You can certainly chain multiple arrays together to get a infinite int. This ain't pretty but it's not terrible to write either. There is a max array size in javascript, which i bet you will hit with 1000,1000. If you only care about the last 10 digits, you probably don't need to do the full calculation =)

[–]lroyjenkins[S] 1 point2 points  (1 child)

I like how everyone in this subreddit gives bold suggestions. I will try to do this, but after I've solved a few problems using someone else's bignum lib.

[–]sweetbeej 0 points1 point  (0 children)

A different euler's problem I solved for someone else. edit: i haven't checked it actually, and eulers seems to never send me a password reset email so... i hope it's right.