Math.BigMul Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
BigMul(Int32, Int32) |
Produz o produto completo de dois números de 32 bits. |
BigMul(Int64, Int64, Int64) |
Gera o produto completo de dois números de 64 bits. |
BigMul(UInt64, UInt64, UInt64) |
Gera o produto completo de dois números de 64 bits sem sinal. |
BigMul(Int32, Int32)
Produz o produto completo de dois números de 32 bits.
public:
static long BigMul(int a, int b);
public static long BigMul (int a, int b);
static member BigMul : int * int -> int64
Public Shared Function BigMul (a As Integer, b As Integer) As Long
Parâmetros
- a
- Int32
O primeiro número a multiplicar.
- b
- Int32
O segundo número a multiplicar.
Retornos
O número que contém o produto dos números especificados.
Exemplos
O exemplo a seguir demonstra o uso do BigMul método para calcular o produto de dois valores inteiros.
// This example demonstrates Math.BigMul()
using namespace System;
int main()
{
int int1 = Int32::MaxValue;
int int2 = Int32::MaxValue;
Int64 longResult;
//
longResult = Math::BigMul( int1, int2 );
Console::WriteLine( "Calculate the product of two Int32 values:" );
Console::WriteLine( "{0} * {1} = {2}", int1, int2, longResult );
}
/*
This example produces the following results:
Calculate the product of two Int32 values:
2147483647 * 2147483647 = 4611686014132420609
*/
// This example demonstrates Math.BigMul()
using System;
class Sample
{
public static void Main()
{
int int1 = Int32.MaxValue;
int int2 = Int32.MaxValue;
long longResult;
//
longResult = Math.BigMul(int1, int2);
Console.WriteLine("Calculate the product of two Int32 values:");
Console.WriteLine("{0} * {1} = {2}", int1, int2, longResult);
}
}
/*
This example produces the following results:
Calculate the product of two Int32 values:
2147483647 * 2147483647 = 4611686014132420609
*/
' This example demonstrates Math.BigMul()
Class Sample
Public Shared Sub Main()
Dim int1 As Integer = Int32.MaxValue
Dim int2 As Integer = Int32.MaxValue
Dim longResult As Long
'
longResult = Math.BigMul(int1, int2)
Console.WriteLine("Calculate the product of two Int32 values:")
Console.WriteLine("{0} * {1} = {2}", int1, int2, longResult)
End Sub
End Class
'
'This example produces the following results:
'Calculate the product of two Int32 values:
'2147483647 * 2147483647 = 4611686014132420609
'
Aplica-se a
BigMul(Int64, Int64, Int64)
Gera o produto completo de dois números de 64 bits.
public:
static long BigMul(long a, long b, [Runtime::InteropServices::Out] long % low);
public static long BigMul (long a, long b, out long low);
static member BigMul : int64 * int64 * int64 -> int64
Public Shared Function BigMul (a As Long, b As Long, ByRef low As Long) As Long
Parâmetros
- a
- Int64
O primeiro número a multiplicar.
- b
- Int64
O segundo número a multiplicar.
- low
- Int64
Quando esse método retorna, contém o baixo 64 bits do produto dos números especificados.
Retornos
O alto 64 bits do produto dos números especificados.
Aplica-se a
BigMul(UInt64, UInt64, UInt64)
Importante
Esta API não está em conformidade com CLS.
Gera o produto completo de dois números de 64 bits sem sinal.
public:
static System::UInt64 BigMul(System::UInt64 a, System::UInt64 b, [Runtime::InteropServices::Out] System::UInt64 % low);
[System.CLSCompliant(false)]
public static ulong BigMul (ulong a, ulong b, out ulong low);
public static ulong BigMul (ulong a, ulong b, out ulong low);
[<System.CLSCompliant(false)>]
static member BigMul : uint64 * uint64 * uint64 -> uint64
static member BigMul : uint64 * uint64 * uint64 -> uint64
Public Shared Function BigMul (a As ULong, b As ULong, ByRef low As ULong) As ULong
Parâmetros
- a
- UInt64
O primeiro número a multiplicar.
- b
- UInt64
O segundo número a multiplicar.
- low
- UInt64
Quando esse método retorna, contém o baixo 64 bits do produto dos números especificados.
Retornos
O alto 64 bits do produto dos números especificados.
- Atributos