__umulh
Блок, относящийся только к системам Microsoft
Вернуть старшие 64 разряда произведения двух 64-разрядных целых чисел без знака.
unsigned __int64 __umulh( unsigned __int64 a, unsigned __int64 b );
Параметры
[in] a
Первое число для умножения.[in] b
Второе число для умножения.
Возвращаемое значение
Старшие 64 разряда 128-разрядного результата умножения.
Требования
Встроенная функция |
Архитектура |
---|---|
__umulh |
x64 |
Файл заголовка <intrin.h>
Заметки
Эти процедуры доступны только как встроенные объекты.
Пример
// umulh.cpp
// processor: X64
#include <cstdio>
#include <intrin.h>
int main()
{
unsigned __int64 i = 0x10;
unsigned __int64 j = 0xFEDCBA9876543210;
unsigned __int64 k = i * j; // k has the low 64 bits
// of the product.
unsigned __int64 result;
result = __umulh(i, j); // result has the high 64 bits
// of the product.
printf_s("0x%I64x * 0x%I64x = 0x%I64x%I64x \n", i, j, result, k);
return 0;
}