NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
https://docs.microsoft.com/en-us/cpp/intrinsics/umul128?view=vs-2019 # Microsoft Specific Multiplies two 64-bit unsigned integers passed in as the first two arguments and puts the high 64 bits of the product in the 64-bit unsigned integer pointed to by HighProduct and returns the low 64 bits of the product. # Syntax ``` unsigned __int64 _umul128( unsigned __int64 Multiplier, unsigned __int64 Multiplicand, unsigned __int64 *HighProduct ); ``` # Parameters 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. # Return Value The low 64 bits of the product. // umul128.c // processor: x64 # Example ``` #include <stdio.h> #include <intrin.h> #pragma intrinsic(_umul128) int main() { unsigned __int64 a = 0x0fffffffffffffffI64; unsigned __int64 b = 0xf0000000I64; unsigned __int64 c, d; d = _umul128(a, b, &c); printf_s("%#I64x * %#I64x = %#I64x%I64x\n", a, b, c, d); } ``` 输出: ``` 0xfffffffffffffff * 0xf0000000 = 0xeffffffffffffff10000000 ```