Asposecpplib

Contains math functions. This is a static type with no instance services. You should never create instances of it by any means. More...

Public Member Functions

template<>
float Min_ (float val1, float val2)
 Returns the smallest single-precision floating point value out of the two specified. More...
 
template<>
double Min_ (double val1, double val2)
 Returns the smallest double-precision floating point value out of the two specified. More...
 
template<>
float Max_ (float val1, float val2)
 Returns the largest single-precision floating point value out of the two specified. More...
 
template<>
double Max_ (double val1, double val2)
 Returns the largest double-precision floating point value out of the two specified. More...
 

Static Public Member Functions

static ASPOSECPP_SHARED_API double Acos (double d)
 Calculates the arccosine of the specifed value. More...
 
static ASPOSECPP_SHARED_API double Asin (double d)
 Calculates the arcsine of the specifed value. More...
 
static ASPOSECPP_SHARED_API double Atan (double d)
 Calculates the arctangen of the specifed value. More...
 
static ASPOSECPP_SHARED_API double Atan2 (double y, double x)
 Calculates the arctangen of the ration of the specifed values. More...
 
static ASPOSECPP_SHARED_API Decimal Ceiling (Decimal d)
 Returns the smallest integral value that is greater than or equal to the specified value. More...
 
static ASPOSECPP_SHARED_API double Ceiling (double a)
 Returns the smallest integral value that is greater than or equal to the specified value. More...
 
static ASPOSECPP_SHARED_API double Cos (double d)
 Calculates the cosine of the specified value. More...
 
static ASPOSECPP_SHARED_API double Cosh (double value)
 Calculates the hyperbolic cosine of the specified value. More...
 
static ASPOSECPP_SHARED_API Decimal Floor (Decimal d)
 Returns the largest integral value that is less than or equal to the specified value. More...
 
static ASPOSECPP_SHARED_API double Floor (double d)
 Returns the largest integral value that is less than or equal to the specified value. More...
 
static ASPOSECPP_SHARED_API double Sin (double a)
 Calculates the sine of the specified value. More...
 
static ASPOSECPP_SHARED_API double Tan (double a)
 Calculates the tangen of the specified value. More...
 
static ASPOSECPP_SHARED_API double Sinh (double value)
 Calculates the hyperbolic sine of the specified value. More...
 
static ASPOSECPP_SHARED_API double Tanh (double value)
 Calculates the hyperbolic tangen of the specified value. More...
 
static ASPOSECPP_SHARED_API double Round (double a)
 Rounds the specified value to the nearest integral value. More...
 
static ASPOSECPP_SHARED_API double Round (double value, int digits)
 Rounds the specified value to the nearest value with the specified number of fractional digits. More...
 
static ASPOSECPP_SHARED_API double Round (double value, MidpointRounding mode)
 Rounds the specified value to the nearest integral number. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers. More...
 
static ASPOSECPP_SHARED_API double Round (double value, int digits, MidpointRounding mode)
 Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers. More...
 
static ASPOSECPP_SHARED_API Decimal Round (Decimal d)
 Rounds the specified value to the nearest integral value. More...
 
static ASPOSECPP_SHARED_API Decimal Round (Decimal value, int digits)
 Rounds the specified value to the nearest value with the specified number of fractional digits. More...
 
static ASPOSECPP_SHARED_API Decimal Round (Decimal d, MidpointRounding mode)
 Rounds the specified value to the nearest integral number. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers. More...
 
static ASPOSECPP_SHARED_API Decimal Round (Decimal d, int digits, MidpointRounding mode)
 Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers. More...
 
static ASPOSECPP_SHARED_API Decimal Truncate (Decimal d)
 Returns the Decimal object representing a value that has integral part equal to that of the value represented by the specified Decimal object of the with all fractional digits discarded. More...
 
static ASPOSECPP_SHARED_API double Truncate (double d)
 Returns a double-precision floating point value that has integral part equal to that of the specified vaue with all fractional digits discarded. More...
 
static ASPOSECPP_SHARED_API double Sqrt (double d)
 Returns the square root of the specified value. More...
 
static ASPOSECPP_SHARED_API double Log (double d)
 Returns the natural logarithm of the specified value. More...
 
static ASPOSECPP_SHARED_API double Log10 (double d)
 Returns the base-10 logarithm of the specified value. More...
 
static ASPOSECPP_SHARED_API double Exp (double d)
 Returns e constant raised to the specified power. More...
 
static ASPOSECPP_SHARED_API double Pow (double x, double y)
 Returns the specified value raised to the specified power. More...
 
static ASPOSECPP_SHARED_API double IEEERemainder (double x, double y)
 Returns the remainder resulting from the division of a specified number by another specified number. More...
 
template<class T >
static T Abs (T value)
 Returns the absolute value of the specified value. More...
 
static Decimal Abs (const Decimal &d)
 Returns the absolute value of a value represented by the specified Decimal object. More...
 
static ASPOSECPP_SHARED_API double Log (double a, double newBase)
 Returns the logarithm of the specified value in the specified base. More...
 
template<typename T >
static std::enable_if< std::is_integral< T >::value &&!std::is_unsigned< T >::value, int >::type Sign (T value)
 Determines the sign of the specified signed integral value. More...
 
template<typename T >
static std::enable_if< std::is_floating_point< T >::value, int >::type Sign (T value)
 Determines the sign of the specified floating-point value. More...
 
static int Sign (const Decimal &value)
 Determines the sign of the specified decimal value. More...
 
static ASPOSECPP_SHARED_API int64_t BigMul (int a, int b)
 Returns the full product of two 32-bit integers. More...
 
static ASPOSECPP_SHARED_API int DivRem (int a, int b, int &result)
 Calculates the quotient of two 32-bit integers and the remainder. More...
 
static ASPOSECPP_SHARED_API int64_t DivRem (int64_t a, int64_t b, int64_t &result)
 Calculates the quotient of two 64-bit integers and the remainder. More...
 
template<class T >
static T Modulus (T x, T y)
 Calculates the remainder resulting from the division one specified value by another specified value. More...
 
template<class T0 , class T1 , class = typename std::enable_if<!std::is_same<T0, T1>::value, void>::type>
static auto Min (T0 val1, T1 val2) -> decltype(val1+val2)
 Returns the smallest value out of two numeric ones specified. More...
 
template<class T0 , class T1 , class = typename std::enable_if<std::is_same<T0, T1>::value, void>::type>
static T0 Min (T0 val1, T1 val2)
 Returns the smallest value out of two numeric ones specified. More...
 
template<class T0 , class T1 , class = typename std::enable_if<!std::is_same<T0, T1>::value, void>::type>
static auto Max (T0 val1, T1 val2) -> decltype(val1+val2)
 Returns the greatest value out of two numeric ones specified. More...
 
template<class T0 , class T1 , class = typename std::enable_if<std::is_same<T0, T1>::value, void>::type>
static T0 Max (T0 val1, T1 val2)
 Returns the greatest value out of two numeric ones specified. More...
 

Static Public Attributes

static const double ASPOSECPP_SHARED_API PI
 The number Pi constant. More...
 
static const double ASPOSECPP_SHARED_API E
 Natural logarithm's base. More...
 
static const double ASPOSECPP_SHARED_API PositiveInfinity
 Represents the positive infinity. More...
 
static const double ASPOSECPP_SHARED_API NegativeInfinity
 Represents the negative infinity. More...
 
static const double ASPOSECPP_SHARED_API NaN
 Represents a not-a-number value. More...
 

Detailed Description

Contains math functions. This is a static type with no instance services. You should never create instances of it by any means.

Member Function Documentation

◆ Abs() [1/2]

static Decimal System::Math::Abs ( const Decimal d)
inlinestatic

Returns the absolute value of a value represented by the specified Decimal object.

Parameters
dA Decimal object
Returns
The Decimal object representing the absolute value of the value represented by value

◆ Abs() [2/2]

template<class T >
static T System::Math::Abs ( value)
inlinestatic

Returns the absolute value of the specified value.

Parameters
valueA value of arithmetic type
Returns
The absolute value of value
Template Parameters
TThe type of the value accepted by the method as an argument

◆ Acos()

static ASPOSECPP_SHARED_API double System::Math::Acos ( double  d)
static

Calculates the arccosine of the specifed value.

Parameters
dThe value to calculate arccosine of
Returns
Arccosine of d

◆ Asin()

static ASPOSECPP_SHARED_API double System::Math::Asin ( double  d)
static

Calculates the arcsine of the specifed value.

Parameters
dThe value to calculate arcsine of
Returns
Arcsine of d

◆ Atan()

static ASPOSECPP_SHARED_API double System::Math::Atan ( double  d)
static

Calculates the arctangen of the specifed value.

Parameters
dThe value to calculate arctangen of
Returns
Arctangen of d

◆ Atan2()

static ASPOSECPP_SHARED_API double System::Math::Atan2 ( double  y,
double  x 
)
static

Calculates the arctangen of the ration of the specifed values.

Parameters
yThe point's y coordinate
xThe point's x coordinate
Returns
Arctangen of y/x

◆ BigMul()

static ASPOSECPP_SHARED_API int64_t System::Math::BigMul ( int  a,
int  b 
)
static

Returns the full product of two 32-bit integers.

Parameters
aThe first multiplier
bThe second multiplier
Returns
The product of a and b

◆ Ceiling() [1/2]

static ASPOSECPP_SHARED_API Decimal System::Math::Ceiling ( Decimal  d)
static

Returns the smallest integral value that is greater than or equal to the specified value.

Parameters
dA decimal number
Returns
The smallest integral value that is greater than or equal to d

◆ Ceiling() [2/2]

static ASPOSECPP_SHARED_API double System::Math::Ceiling ( double  a)
static

Returns the smallest integral value that is greater than or equal to the specified value.

Parameters
aA double-precision floating point number
Returns
The smallest integral value that is greater than or equal to d

◆ Cos()

static ASPOSECPP_SHARED_API double System::Math::Cos ( double  d)
static

Calculates the cosine of the specified value.

Parameters
dThe value to calculate the cosine of
Returns
The cosine of d

◆ Cosh()

static ASPOSECPP_SHARED_API double System::Math::Cosh ( double  value)
static

Calculates the hyperbolic cosine of the specified value.

Parameters
valueThe value to calculate the hyperbolic cosine of
Returns
The hyperbolic cosine of value

◆ DivRem() [1/2]

static ASPOSECPP_SHARED_API int System::Math::DivRem ( int  a,
int  b,
int &  result 
)
static

Calculates the quotient of two 32-bit integers and the remainder.

Parameters
aThe divident
bThe divisor
resultThe output parameter that contains the remainder resulting from division of a by b
Returns
The quotind of a and b

◆ DivRem() [2/2]

static ASPOSECPP_SHARED_API int64_t System::Math::DivRem ( int64_t  a,
int64_t  b,
int64_t &  result 
)
static

Calculates the quotient of two 64-bit integers and the remainder.

Parameters
aThe divident
bThe divisor
resultThe output parameter that contains the remainder resulting from division of a by b
Returns
The quotind of a and b

◆ Exp()

static ASPOSECPP_SHARED_API double System::Math::Exp ( double  d)
static

Returns e constant raised to the specified power.

Parameters
dThe power to raise e constant to
Returns
e constant raised to the power of d

◆ Floor() [1/2]

static ASPOSECPP_SHARED_API Decimal System::Math::Floor ( Decimal  d)
static

Returns the largest integral value that is less than or equal to the specified value.

Parameters
dA decimal number
Returns
The largest integral value that is less than or equal to d

◆ Floor() [2/2]

static ASPOSECPP_SHARED_API double System::Math::Floor ( double  d)
static

Returns the largest integral value that is less than or equal to the specified value.

Parameters
dA double-precision floatig point number
Returns
The largest integral value that is less than or equal to d

◆ IEEERemainder()

static ASPOSECPP_SHARED_API double System::Math::IEEERemainder ( double  x,
double  y 
)
static

Returns the remainder resulting from the division of a specified number by another specified number.

Parameters
xDividend
yDivisor
Returns
The remainder resulting from the division of a specified number by another specified number.

◆ Log() [1/2]

static ASPOSECPP_SHARED_API double System::Math::Log ( double  a,
double  newBase 
)
static

Returns the logarithm of the specified value in the specified base.

Parameters
aA double-precision floating point value
newBaseThe base of the logarithm
Returns
The logarithm of a in the newBase base

◆ Log() [2/2]

static ASPOSECPP_SHARED_API double System::Math::Log ( double  d)
static

Returns the natural logarithm of the specified value.

Parameters
dA double-precision floating point value
Returns
The natural logarithm of d

◆ Log10()

static ASPOSECPP_SHARED_API double System::Math::Log10 ( double  d)
static

Returns the base-10 logarithm of the specified value.

Parameters
dA double-precision floating point value
Returns
The base-10 logarithm of d

◆ Max() [1/2]

template<class T0 , class T1 , class = typename std::enable_if<std::is_same<T0, T1>::value, void>::type>
static T0 System::Math::Max ( T0  val1,
T1  val2 
)
inlinestatic

Returns the greatest value out of two numeric ones specified.

Template Parameters
T0Type of first value.
T1Type of second value.
Parameters
val1First value.
val2Second value.
Returns
Greatest value out of val1 and val2.

◆ Max() [2/2]

template<class T0 , class T1 , class = typename std::enable_if<!std::is_same<T0, T1>::value, void>::type>
static auto System::Math::Max ( T0  val1,
T1  val2 
) -> decltype(val1 + val2)
inlinestatic

Returns the greatest value out of two numeric ones specified.

Template Parameters
T0Type of first value.
T1Type of second value.
Parameters
val1First value.
val2Second value.
Returns
Greatest value out of val1 and val2.

◆ Max_() [1/2]

template<>
double System::Math::Max_ ( double  val1,
double  val2 
)
inline

Returns the largest double-precision floating point value out of the two specified.

Parameters
val1The first comparant
val2The second comparant
Returns
The largest value out of val1 and val2; or NaN if one of the operands is NaN

◆ Max_() [2/2]

template<>
float System::Math::Max_ ( float  val1,
float  val2 
)
inline

Returns the largest single-precision floating point value out of the two specified.

Parameters
val1The first comparant
val2The second comparant
Returns
The largest value out of val1 and val2; or NaN if one of the operands is NaN

◆ Min() [1/2]

template<class T0 , class T1 , class = typename std::enable_if<std::is_same<T0, T1>::value, void>::type>
static T0 System::Math::Min ( T0  val1,
T1  val2 
)
inlinestatic

Returns the smallest value out of two numeric ones specified.

Template Parameters
T0Type of first value.
T1Type of second value.
Parameters
val1First value.
val2Second value.
Returns
Smallest value out of val1 and val2.

◆ Min() [2/2]

template<class T0 , class T1 , class = typename std::enable_if<!std::is_same<T0, T1>::value, void>::type>
static auto System::Math::Min ( T0  val1,
T1  val2 
) -> decltype(val1 + val2)
inlinestatic

Returns the smallest value out of two numeric ones specified.

Template Parameters
T0Type of first value.
T1Type of second value.
Parameters
val1First value.
val2Second value.
Returns
Smallest value out of val1 and val2.

◆ Min_() [1/2]

template<>
double System::Math::Min_ ( double  val1,
double  val2 
)
inline

Returns the smallest double-precision floating point value out of the two specified.

Parameters
val1The first comparant
val2The second comparant
Returns
The smallest value out of val1 and val2; or NaN if one of the operands is NaN

◆ Min_() [2/2]

template<>
float System::Math::Min_ ( float  val1,
float  val2 
)
inline

Returns the smallest single-precision floating point value out of the two specified.

Parameters
val1The first comparant
val2The second comparant
Returns
The smallest value out of val1 and val2; or NaN if one of the operands is NaN

◆ Modulus()

template<class T >
static T System::Math::Modulus ( x,
y 
)
inlinestatic

Calculates the remainder resulting from the division one specified value by another specified value.

Parameters
xThe divident
yThe divisor
Returns
The reminder resulting from the division of x by y
Template Parameters
TThe type of the method's arguments

◆ Pow()

static ASPOSECPP_SHARED_API double System::Math::Pow ( double  x,
double  y 
)
static

Returns the specified value raised to the specified power.

Parameters
xThe value to raise to the specified power
yThe power to raise the specified value to
Returns
x raised to the power of y

◆ Round() [1/8]

static ASPOSECPP_SHARED_API Decimal System::Math::Round ( Decimal  d)
static

Rounds the specified value to the nearest integral value.

Parameters
dThe value to round
Returns
d rounded to the nearest integral value

◆ Round() [2/8]

static ASPOSECPP_SHARED_API Decimal System::Math::Round ( Decimal  d,
int  digits,
MidpointRounding  mode 
)
static

Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
dThe value to round
digitsThe number of fractional digits in the rounded value
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
The number with the specified number of digits nearest to value

◆ Round() [3/8]

static ASPOSECPP_SHARED_API Decimal System::Math::Round ( Decimal  d,
MidpointRounding  mode 
)
static

Rounds the specified value to the nearest integral number. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
dThe value to round
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
d rounded to the nearest integral value

◆ Round() [4/8]

static ASPOSECPP_SHARED_API Decimal System::Math::Round ( Decimal  value,
int  digits 
)
static

Rounds the specified value to the nearest value with the specified number of fractional digits.

Parameters
valueThe value to round
digitsThe number of fractional digits in the rounded value
Returns
The number with the specified number of digits nearest to value

◆ Round() [5/8]

static ASPOSECPP_SHARED_API double System::Math::Round ( double  a)
static

Rounds the specified value to the nearest integral value.

Parameters
aThe value to round
Returns
a rounded to the nearest integral value

◆ Round() [6/8]

static ASPOSECPP_SHARED_API double System::Math::Round ( double  value,
int  digits 
)
static

Rounds the specified value to the nearest value with the specified number of fractional digits.

Parameters
valueThe value to round
digitsThe number of fractional digits in the rounded value
Returns
The number with the specified number of digits nearest to value

◆ Round() [7/8]

static ASPOSECPP_SHARED_API double System::Math::Round ( double  value,
int  digits,
MidpointRounding  mode 
)
static

Rounds the specified value to the nearest value with the specified number of fractional digits. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
valueThe value to round
digitsThe number of fractional digits in the rounded value
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
The number with the specified number of digits nearest to value

◆ Round() [8/8]

static ASPOSECPP_SHARED_API double System::Math::Round ( double  value,
MidpointRounding  mode 
)
static

Rounds the specified value to the nearest integral number. A parameter specifies the function's behavior if the specified value is equally close to two nearest numbers.

Parameters
valueThe value to round
modeSpecifies how to perform the rounding if value is equally close to two nearest numbers.
Returns
value rounded to the nearest integral value

◆ Sign() [1/3]

static int System::Math::Sign ( const Decimal value)
inlinestatic

Determines the sign of the specified decimal value.

Parameters
valueThe value to determine the sign of
Returns
-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0

◆ Sign() [2/3]

template<typename T >
static std::enable_if<std::is_integral<T>::value && !std::is_unsigned<T>::value, int>::type System::Math::Sign ( value)
inlinestatic

Determines the sign of the specified signed integral value.

Parameters
valueThe value to determine the sign of
Returns
-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0
Template Parameters
TThe integral signed type

◆ Sign() [3/3]

template<typename T >
static std::enable_if<std::is_floating_point<T>::value, int>::type System::Math::Sign ( value)
inlinestatic

Determines the sign of the specified floating-point value.

Parameters
valueThe value to determine the sign of
Returns
-1 if value is less than 0; 0 if value is equal to 0; 1 if value is greater than 0
Template Parameters
TThe floating point type of the argument

◆ Sin()

static ASPOSECPP_SHARED_API double System::Math::Sin ( double  a)
static

Calculates the sine of the specified value.

Parameters
aThe value to calculate the sine of
Returns
The sine of a

◆ Sinh()

static ASPOSECPP_SHARED_API double System::Math::Sinh ( double  value)
static

Calculates the hyperbolic sine of the specified value.

Parameters
valueThe value to calculate the hyperbolic sine of
Returns
The hyperbolic sine of value

◆ Sqrt()

static ASPOSECPP_SHARED_API double System::Math::Sqrt ( double  d)
static

Returns the square root of the specified value.

Parameters
dA double-precision floating point value
Returns
The square root of d

◆ Tan()

static ASPOSECPP_SHARED_API double System::Math::Tan ( double  a)
static

Calculates the tangen of the specified value.

Parameters
aThe value to calculate the tangen of
Returns
The tangen of a

◆ Tanh()

static ASPOSECPP_SHARED_API double System::Math::Tanh ( double  value)
static

Calculates the hyperbolic tangen of the specified value.

Parameters
valueThe value to calculate the hyperbolic tangen of
Returns
The hyperbolic tangen of value

◆ Truncate() [1/2]

static ASPOSECPP_SHARED_API Decimal System::Math::Truncate ( Decimal  d)
static

Returns the Decimal object representing a value that has integral part equal to that of the value represented by the specified Decimal object of the with all fractional digits discarded.

Parameters
dA decimal number
Returns
A Decimal object reprsenting a decimal value whose integral part is equal to that of the specified value and fractional digits are all 0.

◆ Truncate() [2/2]

static ASPOSECPP_SHARED_API double System::Math::Truncate ( double  d)
static

Returns a double-precision floating point value that has integral part equal to that of the specified vaue with all fractional digits discarded.

Parameters
dA decimal number
Returns
A double-precision floating point value whose integral part is equal to that of the specified value and fractional digits are all 0.

Member Data Documentation

◆ E

const double ASPOSECPP_SHARED_API System::Math::E
static

Natural logarithm's base.

◆ NaN

const double ASPOSECPP_SHARED_API System::Math::NaN
static

Represents a not-a-number value.

◆ NegativeInfinity

const double ASPOSECPP_SHARED_API System::Math::NegativeInfinity
static

Represents the negative infinity.

◆ PI

const double ASPOSECPP_SHARED_API System::Math::PI
static

The number Pi constant.

◆ PositiveInfinity

const double ASPOSECPP_SHARED_API System::Math::PositiveInfinity
static

Represents the positive infinity.