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

Re: Fudging large value arithmetic in unfriendly languages

Expand Messages
  • alpertron
    ... using ... JavaScript, ... remain ... for ... Phil, Before I started programming in Java, I used Javascript for some of my calculators. At
    Message 1 of 2 , Jul 2, 2002
    • 0 Attachment
      --- In primenumbers@y..., Phil Carmody <thefatphil@y...> wrote:
      > With 80-bit floats, and a 32*32->64 integer multiply, the intel-
      > 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
      > and it would be nice to know quite how far JS can be taken and
      > 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
      > 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


      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:


      Otherwise the Java applet will run, which is much faster. Remember to
      enable Java again after finish running the Javascript.

      Best regards,

      Dario Alpern
    Your message has been successfully submitted and would be delivered to recipients shortly.