Math.IEEERemainder メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Math.IEEERemainder メソッドの意味・解説 

Math.IEEERemainder メソッド

指定した数を別の指定数で除算した結果剰余返します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Function IEEERemainder
 ( _
    x As Double, _
    y As Double _
) As Double
Dim x As Double
Dim y As Double
Dim returnValue As Double

returnValue = Math.IEEERemainder(x, y)
public static double IEEERemainder (
    double x,
    double y
)
public:
static double IEEERemainder (
    double x, 
    double y
)
public static double IEEERemainder (
    double x, 
    double y
)
public static function IEEERemainder
 (
    x : double, 
    y : double
) : double

パラメータ

x

被除数

y

除数

戻り値
x - ( y Q) に等し数値。Q は x / y の商を丸めた近似整数示しますx / y2 つ整数中間位置する場合は、偶数整数返されます。 x - ( y Q) が 0 のとき、x が正である場合は値 +0 が、x が負である場合は値 -0 が返されます。 y = 0 の場合は、NaN (Not-A-Number) が返されます。

解説解説
使用例使用例
' This example demonstrates Math.DivRem()
'                           Math.IEEERemainder()
Imports System

Class Sample
   Public Shared Sub Main()
      Dim int1 As Integer
 = Int32.MaxValue
      Dim int2 As Integer
 = Int32.MaxValue
      Dim intResult As Integer
      Dim long1 As Long
 = Int64.MaxValue
      Dim long2 As Long
 = Int64.MaxValue
      Dim longResult As Long
      Dim doubleResult As Double
      Dim divisor As Double
      Dim nl As [String] = Environment.NewLine
      '
      Console.WriteLine("{0}Calculate the quotient and remainder
 of two Int32 values:", nl)
      intResult = Math.DivRem(int1, 2, int2)
      Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.",
 int1, 2, intResult, int2)
      '
      Console.WriteLine("{0}Calculate the quotient and remainder
 of two Int64 values:", nl)
      longResult = Math.DivRem(long1, 4, long2)
      Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.",
 long1, 4, longResult, long2)
      '
      Dim str1 As [String] = "The
 IEEE remainder of {0:e}/{1:f} is {2:e}"
      divisor = 2.0
      Console.WriteLine("{0}Divide two double-precision floating-point
 values:", nl)
      doubleResult = Math.IEEERemainder([Double].MaxValue, divisor)
      Console.Write("1) ")
      Console.WriteLine(str1, [Double].MaxValue, divisor, doubleResult)
      
      divisor = 3.0
      doubleResult = Math.IEEERemainder([Double].MaxValue, divisor)
      Console.Write("2) ")
      Console.WriteLine(str1, [Double].MaxValue, divisor, doubleResult)
      Console.WriteLine("Note that two positive numbers can yield
 a negative remainder.")
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'Calculate the quotient and remainder of two Int32 values:
'2147483647/2 = 1073741823, with a remainder of 1.
'
'Calculate the quotient and remainder of two Int64 values:
'9223372036854775807/4 = 2305843009213693951, with a remainder of 3.
'
'Divide two double-precision floating-point values:
'1) The IEEE remainder of 1.797693e+308/2.00 is 0.000000e+000
'2) The IEEE remainder of 1.797693e+308/3.00 is -1.000000e+000
'Note that two positive numbers can yield a negative remainder.
'
// This example demonstrates Math.DivRem()
//                           Math.IEEERemainder()
using System;

class Sample 
{
    public static void Main()
 
    {
    int int1 = Int32.MaxValue;
    int int2 = Int32.MaxValue;
    int intResult;
    long long1 = Int64.MaxValue;
    long long2 = Int64.MaxValue;
    long longResult;
    double doubleResult;
    double divisor;
    String nl = Environment.NewLine;
//
    Console.WriteLine("{0}Calculate the quotient and remainder of two Int32
 values:", nl);
    intResult = Math.DivRem(int1, 2, out int2);
    Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.", int1,
 2, intResult, int2);
//
    Console.WriteLine("{0}Calculate the quotient and remainder of two Int64
 values:", nl);
    longResult = Math.DivRem(long1, 4, out long2);
    Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.", long1,
 4, longResult, long2);
//
    String str1 = "The IEEE remainder of {0:e}/{1:f} is {2:e}";
    divisor = 2.0;
    Console.WriteLine("{0}Divide two double-precision floating-point values:",
 nl);
    doubleResult = Math.IEEERemainder(Double.MaxValue, divisor);
    Console.Write("1) ");
    Console.WriteLine(str1, Double.MaxValue, divisor, doubleResult);

    divisor = 3.0;
    doubleResult = Math.IEEERemainder(Double.MaxValue, divisor);
    Console.Write("2) ");
    Console.WriteLine(str1, Double.MaxValue, divisor, doubleResult);
    Console.WriteLine("Note that two positive numbers can yield a negative remainder.");
    }
}
/*
This example produces the following results:

Calculate the quotient and remainder of two Int32 values:
2147483647/2 = 1073741823, with a remainder of 1.

Calculate the quotient and remainder of two Int64 values:
9223372036854775807/4 = 2305843009213693951, with a remainder of 3.

Divide two double-precision floating-point values:
1) The IEEE remainder of 1.797693e+308/2.00 is 0.000000e+000
2) The IEEE remainder of 1.797693e+308/3.00 is -1.000000e+000
Note that two positive numbers can yield a negative remainder.

*/
// This example demonstrates Math.DivRem()
//                           Math.IEEERemainder()
using namespace System;
int main()
{
   int int1 = Int32::MaxValue;
   int int2 = Int32::MaxValue;
   int intResult;
   Int64 long1 = Int64::MaxValue;
   Int64 long2 = Int64::MaxValue;
   Int64 longResult;
   double doubleResult;
   double divisor;
   String^ nl = Environment::NewLine;
   
   //
   Console::WriteLine( "{0}Calculate the quotient and remainder of two Int32
 values:", nl );
   intResult = Math::DivRem( int1, 2, int2 );
   Console::WriteLine( "{0}/{1} = {2}, with a remainder of {3}.", int1,
 2, intResult, int2 );
   
   //
   Console::WriteLine( "{0}Calculate the quotient and remainder of two Int64
 values:", nl );
   longResult = Math::DivRem( long1, 4, long2 );
   Console::WriteLine( "{0}/{1} = {2}, with a remainder of {3}.", long1,
 4, longResult, long2 );
   
   //
   String^ str1 = "The IEEE remainder of {0:e}/{1:f} is {2:e}";
   divisor = 2.0;
   Console::WriteLine( "{0}Divide two double-precision floating-point values:",
 nl );
   doubleResult = Math::IEEERemainder( Double::MaxValue, divisor );
   Console::Write( "1) " );
   Console::WriteLine( str1, Double::MaxValue, divisor, doubleResult );
   divisor = 3.0;
   doubleResult = Math::IEEERemainder( Double::MaxValue, divisor );
   Console::Write( "2) " );
   Console::WriteLine( str1, Double::MaxValue, divisor, doubleResult );
   Console::WriteLine( "Note that two positive numbers can yield a negative
 remainder." );
}

/*
This example produces the following results:

Calculate the quotient and remainder of two Int32 values:
2147483647/2 = 1073741823, with a remainder of 1.

Calculate the quotient and remainder of two Int64 values:
9223372036854775807/4 = 2305843009213693951, with a remainder of 3.

Divide two double-precision floating-point values:
1) The IEEE remainder of 1.797693e+308/2.00 is 0.000000e+000
2) The IEEE remainder of 1.797693e+308/3.00 is -1.000000e+000
Note that two positive numbers can yield a negative remainder.
*/
// This example demonstrates Math.DivRem()
// Math.IEEERemainder()
import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        int int1 = Int32.MaxValue;
        int int2 = Int32.MaxValue;
        int intResult;
        long long1 = Int64.MaxValue;
        long long2 = Int64.MaxValue;
        long longResult;
        double doubleResult;
        double divisor;
        String nl = Environment.get_NewLine();
        //
        Console.WriteLine("{0}Calculate the quotient and " 
            + "remainder of two Int32 values:", nl);
        intResult = System.Math.DivRem(int1, 2, int2);
        Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.", 
            new Object[] { (Int32)int1, (Int32)2,
            (Int32)intResult, (Int32)int2 });
        //
        Console.WriteLine("{0}Calculate the quotient and remainder" 
            + " of two Int64 values:", nl);
        longResult = System.Math.DivRem(long1, 4, long2);
        Console.WriteLine("{0}/{1} = {2}, with a remainder of {3}.", 
            new Object[] { (Int64)long1, (Int32)4, 
            (Int64)longResult, (Int64)long2    });
        //
        String str1 = "The IEEE remainder of {0:e}/{1:f} is {2:e}";
        divisor = 2.0;
        Console.WriteLine("{0}Divide two double-precision" 
            + " floating-point values:", nl);
        doubleResult = System.Math.IEEERemainder(System.Double.MaxValue, divisor);
        Console.Write("1) ");
        Console.WriteLine(str1, 
            ((System.Double)System.Double.MaxValue).ToString("e"),
            ((System.Double)divisor).ToString("f"),
            ((System.Double)doubleResult).ToString("e"));

        divisor = 3.0;
        doubleResult = System.Math.IEEERemainder(System.Double.MaxValue, divisor);
        Console.Write("2) ");
        Console.WriteLine(str1,
            ((System.Double)System.Double.MaxValue).ToString("e"), 
            ((System.Double)divisor).ToString("f"),
            ((System.Double)doubleResult).ToString("e"));
        Console.WriteLine("Note that two positive numbers can" 
            + " yield a negative remainder.");
    } //main
} //Sample

/*
This example produces the following results:

Calculate the quotient and remainder of two Int32 values:
2147483647/2 = 1073741823, with a remainder of 1.

Calculate the quotient and remainder of two Int64 values:
9223372036854775807/4 = 2305843009213693951, with a remainder of 3.

Divide two double-precision floating-point values:
1) The IEEE remainder of 1.797693e+308/2.00 is 0.000000e+000
2) The IEEE remainder of 1.797693e+308/3.00 is -1.000000e+000
Note that two positive numbers can yield a negative remainder.
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からMath.IEEERemainder メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からMath.IEEERemainder メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からMath.IEEERemainder メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Math.IEEERemainder メソッド」の関連用語

Math.IEEERemainder メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Math.IEEERemainder メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS