On Mon, 7 Aug 2017 15:03:00 -0400, Steve Smith wrote:

>Maybe you could show your code.  MP and DP can be tricky, but when you
>CVDG the high D-word, you'd then multiply it by
>9,223,372,036,854,775,808, then by 2 (or something equivalent).  Add
>to what you CVDG from the low D-word.
>
>Of course, this will overflow if the value is too large for 31 digits,
>and may get PD multiply exceptions for much less.  You may have to do
>some weaseling to make it work.  Brute force would be multiplying the
>converted high D-word by 2 64 times.
>
... which still overflows.  Need to break the converted high D-word (which
can not exceed 20 digits) into two 10-bit chunks; multiply each by 2**64
(at most 30 digits), break the bottom one into tswo 10-digit pieces;
add the top 10 dights to the converted top half; and string everything
together.

This is simulating long multiplication.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to