| description | Learn more about: _mul128 | ||
|---|---|---|---|
| title | _mul128 | ||
| ms.date | 09/02/2019 | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | f68914b9-bffb-4e46-b1ba-4c249f7b4ecc |
Microsoft Specific
Multiplies two 64-bit integers passed in as the first two arguments and puts the high 64 bits of the product in the 64-bit integer pointed to by HighProduct and returns the low 64 bits of the product.
__int64 _mul128(
__int64 Multiplier,
__int64 Multiplicand,
__int64 *HighProduct
);Multiplier
[in] The first 64-bit integer to multiply.
Multiplicand
[in] The second 64-bit integer to multiply.
HighProduct
[out] The high 64 bits of the product.
The low 64 bits of the product.
| Intrinsic | Architecture |
|---|---|
_mul128 |
x64 |
Header file <intrin.h>
// mul128.c
// processor: x64
#include <stdio.h>
#include <intrin.h>
#pragma intrinsic(_mul128)
int main()
{
__int64 a = 0x0fffffffffffffffI64;
__int64 b = 0xf0000000I64;
__int64 c, d;
d = _mul128(a, b, &c);
printf_s("%#I64x * %#I64x = %#I64x%I64x\n", a, b, c, d);
}0xfffffffffffffff * 0xf0000000 = 0xeffffffffffffff10000000
END Microsoft Specific