- With 80-bit floats, and a 32*32->64 integer multiply, the intel-using

C/C++ and Asm programmers can without too much hassle write 62*62%62

bit mulmods.

However, I plan to write some little factoring applets in JavaScript,

and it would be nice to know quite how far JS can be taken and remain

precise, without having to resort to multi-word operations, or

bit-by-bit operations?

Does this sound about right?

Floating point multiplication with 52 bits of accuracy

Integer mutliplication with 32 bits of accuracy

=> maybe 84-bit intermediate exactly representable

=> 42*42%42 is probably pushing it.

Which is fairly poor for everything apart from squfof (which uses

half-length values almost the whole time).

I'm not intending the applets to be used in anger, obviously, but for

them to not be utterly useless would be quite nice.

I don't relish the thought of having to write a 'bignum' library in

JavaScript, to be honest. Does anyone have any experience hacking JS

to do such things?

Phil

=====

--

"One cannot delete the Web browser from KDE without

losing the ability to manage files on the user's own

hard disk." - Prof. Stuart E Madnick, MIT.

So called "expert" witness for Microsoft. 2002/05/02

__________________________________________________

Do You Yahoo!?

Yahoo! - Official partner of 2002 FIFA World Cup

http://fifaworldcup.yahoo.com - --- In primenumbers@y..., Phil Carmody <thefatphil@y...> wrote:
> With 80-bit floats, and a 32*32->64 integer multiply, the intel-

using

> C/C++ and Asm programmers can without too much hassle write 62*62%62

JavaScript,

> bit mulmods.

>

> However, I plan to write some little factoring applets in

> and it would be nice to know quite how far JS can be taken and

remain

> precise, without having to resort to multi-word operations, or

for

> bit-by-bit operations?

>

> Does this sound about right?

> Floating point multiplication with 52 bits of accuracy

> Integer mutliplication with 32 bits of accuracy

> => maybe 84-bit intermediate exactly representable

> => 42*42%42 is probably pushing it.

>

> Which is fairly poor for everything apart from squfof (which uses

> half-length values almost the whole time).

>

> I'm not intending the applets to be used in anger, obviously, but

> them to not be utterly useless would be quite nice.

Phil,

>

> I don't relish the thought of having to write a 'bignum' library in

> JavaScript, to be honest. Does anyone have any experience hacking JS

> to do such things?

>

>

> Phil

>

Before I started programming in Java, I used Javascript for some of

my calculators.

At http://www.alpertron.com.ar/QUAD1.HTM you can see the source code

of my Quadratic Diophantine Equation solver in Javascript. It

includes multiple precision functions.

Notice that if you want to run the calculator in Javascript, you

should first disable Java (but not Javascript) and then point your

browser to:

http://www.alpertron.com.ar/QUAD.HTM

Otherwise the Java applet will run, which is much faster. Remember to

enable Java again after finish running the Javascript.

Best regards,

Dario Alpern