Loading ...
Sorry, an error occurred while loading the content.

7834Fudging large value arithmetic in unfriendly languages

Expand Messages
  • Phil Carmody
    Jul 2, 2002
    • 0 Attachment
      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?


      "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
    • Show all 2 messages in this topic