Re: (x * x) % y

New Message Reply About this list Date view Thread view Subject view Author view

mok-kong shen (mok-kong.shen@stud.uni-muenchen.de)
Tue, 27 Apr 1999 12:10:35 +0200


James H. Cloos Jr. wrote:
>

> In short, cf the numerical algorithms section of your nearest
> university or college library. You should be able to find an
> algorithm for arbitrary y requring only ints with
> size(y) <= size(int) < 2*size(y).

As far as I understand, the problem posed was not how to do
multi-precision arithmetics with single precision operations but
to write a piece of code in a high-level programming language
such that the (hidden) hardware register is used and therefore one
achieves the same good efficiency as if an assembler code were
written. Since the standards of programming languages do not
specify the semantics concerning such registers, there is no way
of doing that (anyway if the program is to be standard conform). On
the other hand, compilers often provide routines in addition to what
is required by the language standards. It would be beneficial if
there could be some quasi-standard way of making the full product
of two 32 bit operands (and the reverse operation of division)
available to the programmers of high-level languages. That would
greatly facilitate the writing of packages for multi-precision
arithmetics.

M. K. Shen


New Message Reply About this list Date view Thread view Subject view Author view

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

The following archive was created by hippie-mail 7.98617-22 on Thu May 27 1999 - 23:44:23