CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::MathF Struct Reference

Contains math functions for single-precision floating-point values. This is a static type with no instance services. You should never create instances of it by any means. More...

#include <mathf.h>

Public Types

enum  { MaxRoundingDigits = 6 }
 The maximum number of digits that are taken into account during rounding. More...
 

Static Public Member Functions

static float Acos (float x)
 Calculates the arccosine of the specified value. More...
 
static float Asin (float x)
 Calculates the arcsin of the specified value. More...
 
static float Atan (float x)
 Calculates the arctan of the specified value. More...
 
static float Atan2 (float y, float x)
 Calculates the arctan of the ration of the specified values. More...
 
static float Ceiling (float a)
 Returns the smallest integral value that is greater than or equal to the specified value. More...
 
static float Cos (float x)
 Calculates the cosine of the specified value. More...
 
static float Cosh (float value)
 Calculates the hyperbolic cosine of the specified value. More...
 
static float Floor (float x)
 Returns the largest integral value that is less than or equal to the specified value. More...
 
static float Sin (float a)
 Calculates the sine of the specified value. More...
 
static float Tan (float a)
 Calculates the tangen of the specified value. More...
 
static float Sinh (float value)
 Calculates the hyperbolic sine of the specified value. More...
 
static float Tanh (float value)
 Calculates the hyperbolic tangen of the specified value. More...
 
static float Round (float a)
 Rounds the specified value to the nearest integral value. More...
 
static float Round (float value, int digits)
 Rounds the specified value to the nearest value with the specified number of fractional digits. More...
 
static float Round (float 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 float Round (float 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 float Truncate (float x)
 Returns a float-precision floating point value that has integral part equal to that of the specified value with all fractional digits discarded. More...
 
static float Sqrt (float x)
 Returns the square root of the specified value. More...
 
static float Log (float x)
 Returns the natural logarithm of the specified value. More...
 
static float Log10 (float x)
 Returns the base-10 logarithm of the specified value. More...
 
static float Exp (float x)
 Returns e constant raised to the specified power. More...
 
static float Pow (float x, float y)
 Returns the specified value raised to the specified power. More...
 
static float IEEERemainder (float x, float 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 float Log (float a, float 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 float RoundImpl (float 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 Public Attributes

static const float PI
 The number Pi constant. More...
 
static const float E
 Natural logarithm's base. More...
 
static const float Tau
 Tau value. More...
 

Detailed Description

Contains math functions for single-precision floating-point values. This is a static type with no instance services. You should never create instances of it by any means.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The maximum number of digits that are taken into account during rounding.

Enumerator
MaxRoundingDigits 

Member Function Documentation

◆ Abs()

template<class T >
static T System::MathF::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 float System::MathF::Acos ( float  x)
static

Calculates the arccosine of the specified value.

Parameters
xThe value to calculate arccosine of
Returns
Arccosine of d

◆ Asin()

static float System::MathF::Asin ( float  x)
static

Calculates the arcsin of the specified value.

Parameters
xThe value to calculate arcsin of
Returns
Arcsin of d

◆ Atan()

static float System::MathF::Atan ( float  x)
static

Calculates the arctan of the specified value.

Parameters
xThe value to calculate arctan of
Returns
Arctan of d

◆ Atan2()

static float System::MathF::Atan2 ( float  y,
float  x 
)
static

Calculates the arctan of the ration of the specified values.

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

◆ Ceiling()

static float System::MathF::Ceiling ( float  a)
static

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

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

◆ Cos()

static float System::MathF::Cos ( float  x)
static

Calculates the cosine of the specified value.

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

◆ Cosh()

static float System::MathF::Cosh ( float  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

◆ Exp()

static float System::MathF::Exp ( float  x)
static

Returns e constant raised to the specified power.

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

◆ Floor()

static float System::MathF::Floor ( float  x)
static

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

Parameters
xA float-precision floating point number
Returns
The largest integral value that is less than or equal to d

◆ IEEERemainder()

static float System::MathF::IEEERemainder ( float  x,
float  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 float System::MathF::Log ( float  a,
float  newBase 
)
static

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

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

◆ Log() [2/2]

static float System::MathF::Log ( float  x)
static

Returns the natural logarithm of the specified value.

Parameters
xA float-precision floating point value
Returns
The natural logarithm of d

◆ Log10()

static float System::MathF::Log10 ( float  x)
static

Returns the base-10 logarithm of the specified value.

Parameters
xA float-precision floating point value
Returns
The base-10 logarithm of d

◆ Pow()

static float System::MathF::Pow ( float  x,
float  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/4]

static float System::MathF::Round ( float  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() [2/4]

static float System::MathF::Round ( float  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() [3/4]

static float System::MathF::Round ( float  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() [4/4]

static float System::MathF::Round ( float  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

◆ RoundImpl()

static float System::MathF::RoundImpl ( float  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

◆ Sign() [1/2]

template<typename T >
static std::enable_if< std::is_integral< T >::value &&!std::is_unsigned< T >::value, int >::type System::MathF::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() [2/2]

template<typename T >
static std::enable_if< std::is_floating_point< T >::value, int >::type System::MathF::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 float System::MathF::Sin ( float  a)
static

Calculates the sine of the specified value.

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

◆ Sinh()

static float System::MathF::Sinh ( float  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 float System::MathF::Sqrt ( float  x)
static

Returns the square root of the specified value.

Parameters
xA float-precision floating point value
Returns
The square root of d

◆ Tan()

static float System::MathF::Tan ( float  a)
static

Calculates the tangen of the specified value.

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

◆ Tanh()

static float System::MathF::Tanh ( float  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()

static float System::MathF::Truncate ( float  x)
static

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

Parameters
xA decimal number
Returns
A float-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 float System::MathF::E
static

Natural logarithm's base.

◆ PI

const float System::MathF::PI
static

The number Pi constant.

◆ Tau

const float System::MathF::Tau
static

Tau value.