Math.BigMul メソッド

定義

オーバーロード

BigMul(Int32, Int32)

2 つの 32 ビット数値の完全な積を生成します。Produces the full product of two 32-bit numbers.

BigMul(Int64, Int64, Int64)

2 つの 64 ビット数値の完全な積を生成します。Produces the full product of two 64-bit numbers.

BigMul(UInt64, UInt64, UInt64)

2 つの符号なし 64 ビット数値の完全な積を生成します。Produces the full product of two unsigned 64-bit numbers.

BigMul(Int32, Int32)

2 つの 32 ビット数値の完全な積を生成します。Produces the full product of two 32-bit numbers.

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

パラメーター

a
Int32

乗算対象の最初の数。The first number to multiply.

b
Int32

乗算対象の 2 番目の数。The second number to multiply.

戻り値

Int64

指定した数値の積を含む数。The number containing the product of the specified numbers.

次の例は、メソッドを使用して BigMul 2 つの整数値の積を計算する方法を示しています。The following example demonstrates the use of the BigMul method to calculate the product of two integer values.

// 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
'

適用対象

BigMul(Int64, Int64, Int64)

2 つの 64 ビット数値の完全な積を生成します。Produces the full product of two 64-bit numbers.

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

パラメーター

a
Int64

乗算対象の最初の数。The first number to multiply.

b
Int64

乗算対象の 2 番目の数。The second number to multiply.

low
Int64

指定した数値の積の下位 64 ビット。The low 64-bit of the product of the specified numbers.

戻り値

Int64

指定した数値の積の上位 64 ビット。The high 64-bit of the product of the specied numbers.

適用対象

BigMul(UInt64, UInt64, UInt64)

重要

この API は CLS 準拠ではありません。

2 つの符号なし 64 ビット数値の完全な積を生成します。Produces the full product of two unsigned 64-bit numbers.

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

パラメーター

a
UInt64

乗算対象の最初の数。The first number to multiply.

b
UInt64

乗算対象の 2 番目の数。The second number to multiply.

low
UInt64

指定した数値の積の下位 64 ビット。The low 64-bit of the product of the specified numbers.

戻り値

UInt64

指定した数値の積の上位 64 ビット。The high 64-bit of the product of the specied numbers.

属性

適用対象