Freigeben über


__mulh

Microsoft-spezifisch

Gibt die oberen 64 Bits des Produkts von zwei 64-Bit-Ganzzahlen mit Vorzeichen zurück.

__int64 __mulh( 
   __int64 a, 
   __int64 b 
);

Parameter

  • [in] a
    Die erste zu multiplizierende Zahl.

  • [in] b
    Die zweite zu multiplizierende Zahl.

Rückgabewert

Die oberen 64 Bits des 128-Bit-Ergebnisses der Multiplikation.

Anforderungen

Intrinsisch

Architektur

__mulh

x64

Headerdatei <intrin.h>

Hinweise

Diese Routine ist als systeminterne Funktion nur verfügbar.

Beispiel

// mulh.cpp
// processor: x64
#include <stdio.h>
#include <intrin.h>

#pragma intrinsic (__mulh)

int main()
{
    __int64 a = 0x0fffffffffffffffI64;
    __int64 b = 0xf0000000I64;

    __int64 result = __mulh(a, b); // the high 64 bits
    __int64 result2 = a * b; // the low 64 bits

    printf_s(" %#I64x * %#I64x = %#I64x%I64x\n",
             a, b, result, result2);
}
  

Siehe auch

Referenz

Intrinsische Compilerfunktionen