C# Decimal Equals(Decimal, Decimal)

Description

Decimal Equals(Decimal, Decimal) returns a value indicating whether two specified instances of Decimal represent the same value.

Syntax

Decimal.Equals(Decimal, Decimal) has the following syntax.


public static bool Equals(
  decimal d1,
  decimal d2
)

Parameters

Decimal.Equals(Decimal, Decimal) has the following parameters.

  • d1 - The first value to compare.
  • d2 - The second value to compare.

Returns

Decimal.Equals(Decimal, Decimal) method returns true if d1 and d2 are equal; otherwise, false.

Example

The following code example shows how to use calculates quotients with the Divide method.


using System;// w  w w. j a va 2 s .co  m

class DecimalMulDivRemDemo
{

    public static void Main( )
    {
        Console.WriteLine(decimal.Equals( 1000M, 7M) );
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version