LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

long long multiply - (64-bit * 64-bit) to 128-bit result

In CVI when multiplying two 64-bit integers the result by default is the lower 64-bits of the multiply.

Is there an easy way to get the upper 64-bits?

Tx,

Matt

0 Kudos
Message 1 of 4
(3,514 Views)

maybe this code helps: (I did not try it)  https://www.codeproject.com/Tips/618570/UInt-Multiplication-Squaring

0 Kudos
Message 2 of 4
(3,482 Views)

Splitting the long long up into 2 longs and doing 4 long multiplies and adds is what I had been doing.  I was hoping that there was some CPU instruction that I could get at that would give me the upper product directly which would really cut the computational time of extended arithmetic dramatically.  Apparently there is not, since I can't find any reference to it on my others searches.  

Tx,

Matt

0 Kudos
Message 3 of 4
(3,451 Views)

Yeah unfortunately I think splitting it up into two 32-bit then performing 4 multiplication operations is probably going to be your best bet as CVI doesn't have built-in functionality for this and doesn't support 128-bit numerics.

Applications Engineering
National Instruments
0 Kudos
Message 4 of 4
(3,438 Views)