Table of Contents

Class DecimalMath

Namespace
NumSharp.Utilities
Assembly
NumSharp.dll

Provides transcendental math functions for decimal type. .NET does not provide these natively since decimal is designed for financial calculations.

public static class DecimalMath
Inheritance
DecimalMath
Inherited Members

Fields

E

Euler's number e.

public const decimal E = 2.7182818284590452353602874714

Field Value

decimal

Ln10

Natural logarithm of 10.

public const decimal Ln10 = 2.3025850929940456840179914547

Field Value

decimal

Ln2

Natural logarithm of 2.

public const decimal Ln2 = 0.6931471805599453094172321215

Field Value

decimal

Pi

The pi constant. Pi radians = 180 degrees.

public const decimal Pi = 3.1415926535897932384626433833

Field Value

decimal

PiHalf

Pi / 2 = 90 degrees.

public const decimal PiHalf = 1.5707963267948966192313216916

Field Value

decimal

PiQuarter

Pi / 4 = 45 degrees.

public const decimal PiQuarter = 0.7853981633974483096156608458

Field Value

decimal

TwoPi

2 * Pi = 360 degrees.

public const decimal TwoPi = 6.2831853071795864769252867666

Field Value

decimal

Methods

ATan(decimal)

Returns the angle whose tangent is the specified number.

public static decimal ATan(decimal x)

Parameters

x decimal

Returns

decimal

ATan2(decimal, decimal)

Returns the angle whose tangent is the quotient of two numbers.

public static decimal ATan2(decimal y, decimal x)

Parameters

y decimal

The y coordinate.

x decimal

The x coordinate.

Returns

decimal

Angle in radians, -pi to pi.

Exp(decimal)

Returns e raised to the specified power.

public static decimal Exp(decimal d)

Parameters

d decimal

Returns

decimal

Log(decimal)

Returns the natural (base e) logarithm of a number.

public static decimal Log(decimal d)

Parameters

d decimal

Returns

decimal

Log10(decimal)

Returns the base 10 logarithm of a number.

public static decimal Log10(decimal d)

Parameters

d decimal

Returns

decimal

Pow(decimal, decimal)

Returns x raised to the power y.

public static decimal Pow(decimal x, decimal y)

Parameters

x decimal
y decimal

Returns

decimal

Remainder(decimal, decimal)

Computes remainder with maximum precision retained.

public static decimal Remainder(decimal d1, decimal d2)

Parameters

d1 decimal
d2 decimal

Returns

decimal

Sqrt(decimal)

Returns the square root of a decimal using the Babylonian method.

public static decimal Sqrt(decimal s)

Parameters

s decimal

A non-negative number.

Returns

decimal