次の方法で共有


Math.BigMul メソッド

メモ : この名前空間、クラス、およびメンバは、.NET Framework Version 1.1 だけでサポートされています。

2 つの 32 ビット数値の完全な積を生成します。

Public Shared Function BigMul( _
   ByVal a As Integer, _   ByVal b As Integer _) As Long
[C#]
public static long BigMul(inta,intb);
[C++]
public: static __int64 BigMul(inta,intb);
[JScript]
public static function BigMul(
   a : int,b : int) : long;

パラメータ

  • a
    乗算する最初の Int32
  • b
    乗算する 2 番目の Int32

戻り値

指定した数値の積を格納している Int64

使用例

 
' This example demonstrates Math.BigMul()
Imports System

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 'Main
End Class 'Sample
'
'This example produces the following results:
'Calculate the product of two Int32 values:
'2147483647 * 2147483647 = 4611686014132420609
'

[C#] 
// 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
*/

[C++] 
// This example demonstrates Math.BigMul()
#using <mscorlib.dll>
using namespace System;

int main() 
{
    int int1 = Int32::MaxValue;
    int int2 = Int32::MaxValue;
    Int64 longResult;
//
    longResult = Math::BigMul(int1, int2);
    Console::WriteLine(S"Calculate the product of two Int32 values:");
    Console::WriteLine(S"{0} * {1} = {2}", __box(int1), __box(int2), __box(longResult));
}
/*
This example produces the following results:
Calculate the product of two Int32 values:
2147483647 * 2147483647 = 4611686014132420609
*/

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, Common Language Infrastructure (CLI) Standard

参照

Math クラス | Math メンバ | System 名前空間