C# Decimal Divide

Description

Decimal Divide divides two specified Decimal values.

Syntax

Decimal.Divide has the following syntax.


public static decimal Divide(
  decimal d1,
  decimal d2
)

Parameters

Decimal.Divide has the following parameters.

  • d1 - The dividend.
  • d2 - The divisor.

Returns

Decimal.Divide method returns The result of dividing d1 by d2.

Example

The following code example calculates quotients with the Divide method.


using System;// w w  w .  j a v  a 2  s .c  o m

class DecimalMulDivRemDemo
{

    public static void Main( )
    {
        Console.WriteLine(decimal.Divide( 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