__umulh
Microsoft 전용
64비트 부호 없는 두 정수의 곱에서 상위 64비트를 반환합니다.
unsigned __int64 __umulh( unsigned __int64 a, unsigned __int64 b );
매개 변수
[in] a
곱할 첫 번째 숫자입니다.[in] b
곱할 두 번째 숫자입니다.
반환 값
곱셈의 128비트 결과에서 상위 64비트입니다.
요구 사항
내장 함수 |
아키텍처 |
---|---|
__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;
}