Table of Contents

Class MathFunctions

Namespace
SignalSharp.Utilities
Assembly
SignalSharp.dll

Provides a set of mathematical functions for numerical data processing.

public static class MathFunctions
Inheritance
MathFunctions
Inherited Members

Methods

Factorial(int)

Calculates the factorial of a non-negative integer.

public static int Factorial(int n)

Parameters

n int

The non-negative integer, at most 12.

Returns

int

The factorial of the integer.

Remarks

12! is the largest factorial that fits in an int; larger values would silently overflow, so they are rejected. Use Factorial(BigInteger) for larger factorials.

Exceptions

ArgumentOutOfRangeException

Thrown when n is negative or greater than 12.

Factorial(BigInteger)

Calculates the factorial of a non-negative integer.

public static BigInteger Factorial(BigInteger n)

Parameters

n BigInteger

The non-negative integer.

Returns

BigInteger

The factorial of the integer.