Math

Overview

Math operations class.

Location

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

Math()

 

init()

 

Math()

Abs (Double): Double

Returns the absolute value for a double.

 

class method Abs(i: Double): Double

 

static Double Abs(Double i)

 

static func Abs(_ i: Double) -> Double

 

static Double Abs(Double i)

Parameters:

  • i:

Abs (Int32): Int32

Returns the absolute value for an int32.

 

class method Abs(i: Int32): Int32

 

static Int32 Abs(Int32 i)

 

static func Abs(_ i: Int32) -> Int32

 

static Int32 Abs(Int32 i)

Parameters:

  • i:

Abs (Int64): Int64

Returns the absolute value for a int64.

 

class method Abs(i: Int64): Int64

 

static Int64 Abs(Int64 i)

 

static func Abs(_ i: Int64) -> Int64

 

static Int64 Abs(Int64 i)

Parameters:

  • i:

Acos

Returns the arc cosine value for a double.

 

class method Acos(d: Double): Double

 

static Double Acos(Double d)

 

static func Acos(_ d: Double) -> Double

 

static Double Acos(Double d)

Parameters:

  • d:

Asin

Return the arc sine of d, in radians.

 

class method Asin(d: Double): Double

 

static Double Asin(Double d)

 

static func Asin(_ d: Double) -> Double

 

static Double Asin(Double d)

Parameters:

  • d:

Atan

Return the arc tangent of d, in radians.

 

class method Atan(d: Double): Double

 

static Double Atan(Double d)

 

static func Atan(_ d: Double) -> Double

 

static Double Atan(Double d)

Parameters:

  • d:

Atan2

The Math.Stan2 function returns the arctangent of the quotient of x.

 

class method Atan2(x: Double; y: Double): Double

 

static Double Atan2(Double x, Double y)

 

static func Atan2(_ x: Double, _ y: Double) -> Double

 

static Double Atan2(Double x, Double y)

Parameters:

  • x:
  • y:

Ceiling (Double): Double

Returns the ceiling of d, the smallest integer greater than or equal to d.

 

class method Ceiling(d: Double): Double

 

static Double Ceiling(Double d)

 

static func Ceiling(_ d: Double) -> Double

 

static Double Ceiling(Double d)

Parameters:

  • d:

Ceiling (Single): Single

Returns the ceiling of d, the smallest integer greater than or equal to d.

 

class method Ceiling(d: Single): Single

 

static Single Ceiling(Single d)

 

static func Ceiling(_ d: Single) -> Single

 

static Single Ceiling(Single d)

Parameters:

  • d:

Cos

Returns the cosine value of d.

 

class method Cos(d: Double): Double

 

static Double Cos(Double d)

 

static func Cos(_ d: Double) -> Double

 

static Double Cos(Double d)

Parameters:

  • d:

Cosh

Return the hyperbolic cosine of d.

 

class method Cosh(d: Double): Double

 

static Double Cosh(Double d)

 

static func Cosh(_ d: Double) -> Double

 

static Double Cosh(Double d)

Parameters:

  • d:

E

Returns the base of natural logarithms, e, approximately 2.718.

 

const E: Double = 2,71828182845905;

 

const Double E = 2,71828182845905

 

static let E: Double = 2,71828182845905

 

static final Double E = 2,71828182845905

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Exp

Returns e ^^ x.

 

class method Exp(d: Double): Double

 

static Double Exp(Double d)

 

static func Exp(_ d: Double) -> Double

 

static Double Exp(Double d)

Parameters:

  • d:

Exp2

Returns the base2 exponent of d, 2^^ e.

 

class method Exp2(d: Double): Double

 

static Double Exp2(Double d)

 

static func Exp2(_ d: Double) -> Double

 

static Double Exp2(Double d)

Parameters:

  • d:

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

Floor (Double): Double

Returns the Floor of d, the smallest integer less than or equal to d.

 

class method Floor(d: Double): Double

 

static Double Floor(Double d)

 

static func Floor(_ d: Double) -> Double

 

static Double Floor(Double d)

Parameters:

  • d:

Floor (Single): Single

Returns the Floor of d, the smallest integer less than or equal to d.

 

class method Floor(d: Single): Single

 

static Single Floor(Single d)

 

static func Floor(_ d: Single) -> Single

 

static Single Floor(Single d)

Parameters:

  • d:

fmod

Returns the float mod value of x mod y.

 

class method fmod(x: Double; y: Double): Double

 

static Double fmod(Double x, Double y)

 

static func fmod(_ x: Double, _ y: Double) -> Double

 

static Double fmod(Double x, Double y)

Parameters:

  • x:
  • y:

fmodf

Returns the float mod value of x mod y.

 

class method fmodf(x: Single; y: Single): Single

 

static Single fmodf(Single x, Single y)

 

static func fmodf(_ x: Single, _ y: Single) -> Single

 

static Single fmodf(Single x, Single y)

Parameters:

  • x:
  • y:

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

IEEERemainder

Returns the remainder according to the IEEE spec.

 

class method IEEERemainder(x: Double; y: Double): Double

 

static Double IEEERemainder(Double x, Double y)

 

static func IEEERemainder(_ x: Double, _ y: Double) -> Double

 

static Double IEEERemainder(Double x, Double y)

Parameters:

  • x:
  • y:

Log

Returns the logarithm of a.

 

class method Log(a: Double): Double

 

static Double Log(Double a)

 

static func Log(_ a: Double) -> Double

 

static Double Log(Double a)

Parameters:

  • a:

Log10

Returns the base 10 logarithm of a.

 

class method Log10(a: Double): Double

 

static Double Log10(Double a)

 

static func Log10(_ a: Double) -> Double

 

static Double Log10(Double a)

Parameters:

  • a:

Log2

Returns the base 2 logarithm of a.

 

class method Log2(a: Double): Double

 

static Double Log2(Double a)

 

static func Log2(_ a: Double) -> Double

 

static Double Log2(Double a)

Parameters:

  • a:

Max (Double, Double): Double

Returns the max of a and b.

 

class method Max(a: Double; b: Double): Double

 

static Double Max(Double a, Double b)

 

static func Max(_ a: Double, _ b: Double) -> Double

 

static Double Max(Double a, Double b)

Parameters:

  • a:
  • b:

Max (Int32, Int32): Int32

Returns the max of a and b.

 

class method Max(a: Int32; b: Int32): Int32

 

static Int32 Max(Int32 a, Int32 b)

 

static func Max(_ a: Int32, _ b: Int32) -> Int32

 

static Int32 Max(Int32 a, Int32 b)

Parameters:

  • a:
  • b:

Max (Int64, Int64): Int64

Returns the max of a and b.

 

class method Max(a: Int64; b: Int64): Int64

 

static Int64 Max(Int64 a, Int64 b)

 

static func Max(_ a: Int64, _ b: Int64) -> Int64

 

static Int64 Max(Int64 a, Int64 b)

Parameters:

  • a:
  • b:

Min (Double, Double): Double

Returns the min of a and b.

 

class method Min(a: Double; b: Double): Double

 

static Double Min(Double a, Double b)

 

static func Min(_ a: Double, _ b: Double) -> Double

 

static Double Min(Double a, Double b)

Parameters:

  • a:
  • b:

Min (Int32, Int32): Int32

Returns the min of a and b.

 

class method Min(a: Int32; b: Int32): Int32

 

static Int32 Min(Int32 a, Int32 b)

 

static func Min(_ a: Int32, _ b: Int32) -> Int32

 

static Int32 Min(Int32 a, Int32 b)

Parameters:

  • a:
  • b:

Min (Int64, Int64): Int64

Returns the min of a and b.

 

class method Min(a: Int64; b: Int64): Int64

 

static Int64 Min(Int64 a, Int64 b)

 

static func Min(_ a: Int64, _ b: Int64) -> Int64

 

static Int64 Min(Int64 a, Int64 b)

Parameters:

  • a:
  • b:

PI

Returns the PI value, ~ 3.14.

 

const PI: Double = 3,14159265358979;

 

const Double PI = 3,14159265358979

 

static let PI: Double = 3,14159265358979

 

static final Double PI = 3,14159265358979

Pow (Double, Double): Double

Returns the power of x and y: x**y

 

class method Pow(x: Double; y: Double): Double

 

static Double Pow(Double x, Double y)

 

static func Pow(_ x: Double, _ y: Double) -> Double

 

static Double Pow(Double x, Double y)

Parameters:

  • x:
  • y:

Pow (Double, Int32): Double

Returns the power of x and y: x**y

 

class method Pow(x: Double; y: Int32): Double

 

static Double Pow(Double x, Int32 y)

 

static func Pow(_ x: Double, _ y: Int32) -> Double

 

static Double Pow(Double x, Int32 y)

Parameters:

  • x:
  • y:

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Round

Round the value of a, according to bankers rounding.

 

class method Round(a: Double): Int64

 

static Int64 Round(Double a)

 

static func Round(_ a: Double) -> Int64

 

static Int64 Round(Double a)

Parameters:

  • a:

Sign

Returns the sign of d.

 

class method Sign(d: Double): Int32

 

static Int32 Sign(Double d)

 

static func Sign(_ d: Double) -> Int32

 

static Int32 Sign(Double d)

Parameters:

  • d:

Sin

Returns the sine of x.

 

class method Sin(x: Double): Double

 

static Double Sin(Double x)

 

static func Sin(_ x: Double) -> Double

 

static Double Sin(Double x)

Parameters:

  • x:

Sinh

Returns the hyperbolic sine of x.

 

class method Sinh(x: Double): Double

 

static Double Sinh(Double x)

 

static func Sinh(_ x: Double) -> Double

 

static Double Sinh(Double x)

Parameters:

  • x:

Sqrt

Returns the square root of d.

 

class method Sqrt(d: Double): Double

 

static Double Sqrt(Double d)

 

static func Sqrt(_ d: Double) -> Double

 

static Double Sqrt(Double d)

Parameters:

  • d:

Tan

Returns the tangent of d.

 

class method Tan(d: Double): Double

 

static Double Tan(Double d)

 

static func Tan(_ d: Double) -> Double

 

static Double Tan(Double d)

Parameters:

  • d:

Tanh

Returns the hyperbolic tangent of d.

 

class method Tanh(d: Double): Double

 

static Double Tanh(Double d)

 

static func Tanh(_ d: Double) -> Double

 

static Double Tanh(Double d)

Parameters:

  • d:

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

Truncate (Double): Double

Gets the integeral value of d.

 

class method Truncate(d: Double): Double

 

static Double Truncate(Double d)

 

static func Truncate(_ d: Double) -> Double

 

static Double Truncate(Double d)

Parameters:

  • d:

Truncate (Single): Single

Gets the integeral value of d.

 

class method Truncate(d: Single): Single

 

static Single Truncate(Single d)

 

static func Truncate(_ d: Single) -> Single

 

static Single Truncate(Single d)

Parameters:

  • d:

 

E

Returns the base of natural logarithms, e, approximately 2.718.

 

const E: Double = 2,71828182845905;

 

const Double E = 2,71828182845905

 

static let E: Double = 2,71828182845905

 

static final Double E = 2,71828182845905

PI

Returns the PI value, ~ 3.14.

 

const PI: Double = 3,14159265358979;

 

const Double PI = 3,14159265358979

 

static let PI: Double = 3,14159265358979

 

static final Double PI = 3,14159265358979

 

Abs (Double): Double

Returns the absolute value for a double.

 

class method Abs(i: Double): Double

 

static Double Abs(Double i)

 

static func Abs(_ i: Double) -> Double

 

static Double Abs(Double i)

Parameters:

  • i:

Abs (Int32): Int32

Returns the absolute value for an int32.

 

class method Abs(i: Int32): Int32

 

static Int32 Abs(Int32 i)

 

static func Abs(_ i: Int32) -> Int32

 

static Int32 Abs(Int32 i)

Parameters:

  • i:

Abs (Int64): Int64

Returns the absolute value for a int64.

 

class method Abs(i: Int64): Int64

 

static Int64 Abs(Int64 i)

 

static func Abs(_ i: Int64) -> Int64

 

static Int64 Abs(Int64 i)

Parameters:

  • i:

Acos

Returns the arc cosine value for a double.

 

class method Acos(d: Double): Double

 

static Double Acos(Double d)

 

static func Acos(_ d: Double) -> Double

 

static Double Acos(Double d)

Parameters:

  • d:

Asin

Return the arc sine of d, in radians.

 

class method Asin(d: Double): Double

 

static Double Asin(Double d)

 

static func Asin(_ d: Double) -> Double

 

static Double Asin(Double d)

Parameters:

  • d:

Atan

Return the arc tangent of d, in radians.

 

class method Atan(d: Double): Double

 

static Double Atan(Double d)

 

static func Atan(_ d: Double) -> Double

 

static Double Atan(Double d)

Parameters:

  • d:

Atan2

The Math.Stan2 function returns the arctangent of the quotient of x.

 

class method Atan2(x: Double; y: Double): Double

 

static Double Atan2(Double x, Double y)

 

static func Atan2(_ x: Double, _ y: Double) -> Double

 

static Double Atan2(Double x, Double y)

Parameters:

  • x:
  • y:

Ceiling (Double): Double

Returns the ceiling of d, the smallest integer greater than or equal to d.

 

class method Ceiling(d: Double): Double

 

static Double Ceiling(Double d)

 

static func Ceiling(_ d: Double) -> Double

 

static Double Ceiling(Double d)

Parameters:

  • d:

Ceiling (Single): Single

Returns the ceiling of d, the smallest integer greater than or equal to d.

 

class method Ceiling(d: Single): Single

 

static Single Ceiling(Single d)

 

static func Ceiling(_ d: Single) -> Single

 

static Single Ceiling(Single d)

Parameters:

  • d:

Cos

Returns the cosine value of d.

 

class method Cos(d: Double): Double

 

static Double Cos(Double d)

 

static func Cos(_ d: Double) -> Double

 

static Double Cos(Double d)

Parameters:

  • d:

Cosh

Return the hyperbolic cosine of d.

 

class method Cosh(d: Double): Double

 

static Double Cosh(Double d)

 

static func Cosh(_ d: Double) -> Double

 

static Double Cosh(Double d)

Parameters:

  • d:

Exp

Returns e ^^ x.

 

class method Exp(d: Double): Double

 

static Double Exp(Double d)

 

static func Exp(_ d: Double) -> Double

 

static Double Exp(Double d)

Parameters:

  • d:

Exp2

Returns the base2 exponent of d, 2^^ e.

 

class method Exp2(d: Double): Double

 

static Double Exp2(Double d)

 

static func Exp2(_ d: Double) -> Double

 

static Double Exp2(Double d)

Parameters:

  • d:

Floor (Double): Double

Returns the Floor of d, the smallest integer less than or equal to d.

 

class method Floor(d: Double): Double

 

static Double Floor(Double d)

 

static func Floor(_ d: Double) -> Double

 

static Double Floor(Double d)

Parameters:

  • d:

Floor (Single): Single

Returns the Floor of d, the smallest integer less than or equal to d.

 

class method Floor(d: Single): Single

 

static Single Floor(Single d)

 

static func Floor(_ d: Single) -> Single

 

static Single Floor(Single d)

Parameters:

  • d:

fmod

Returns the float mod value of x mod y.

 

class method fmod(x: Double; y: Double): Double

 

static Double fmod(Double x, Double y)

 

static func fmod(_ x: Double, _ y: Double) -> Double

 

static Double fmod(Double x, Double y)

Parameters:

  • x:
  • y:

fmodf

Returns the float mod value of x mod y.

 

class method fmodf(x: Single; y: Single): Single

 

static Single fmodf(Single x, Single y)

 

static func fmodf(_ x: Single, _ y: Single) -> Single

 

static Single fmodf(Single x, Single y)

Parameters:

  • x:
  • y:

IEEERemainder

Returns the remainder according to the IEEE spec.

 

class method IEEERemainder(x: Double; y: Double): Double

 

static Double IEEERemainder(Double x, Double y)

 

static func IEEERemainder(_ x: Double, _ y: Double) -> Double

 

static Double IEEERemainder(Double x, Double y)

Parameters:

  • x:
  • y:

Log

Returns the logarithm of a.

 

class method Log(a: Double): Double

 

static Double Log(Double a)

 

static func Log(_ a: Double) -> Double

 

static Double Log(Double a)

Parameters:

  • a:

Log10

Returns the base 10 logarithm of a.

 

class method Log10(a: Double): Double

 

static Double Log10(Double a)

 

static func Log10(_ a: Double) -> Double

 

static Double Log10(Double a)

Parameters:

  • a:

Log2

Returns the base 2 logarithm of a.

 

class method Log2(a: Double): Double

 

static Double Log2(Double a)

 

static func Log2(_ a: Double) -> Double

 

static Double Log2(Double a)

Parameters:

  • a:

Max (Double, Double): Double

Returns the max of a and b.

 

class method Max(a: Double; b: Double): Double

 

static Double Max(Double a, Double b)

 

static func Max(_ a: Double, _ b: Double) -> Double

 

static Double Max(Double a, Double b)

Parameters:

  • a:
  • b:

Max (Int32, Int32): Int32

Returns the max of a and b.

 

class method Max(a: Int32; b: Int32): Int32

 

static Int32 Max(Int32 a, Int32 b)

 

static func Max(_ a: Int32, _ b: Int32) -> Int32

 

static Int32 Max(Int32 a, Int32 b)

Parameters:

  • a:
  • b:

Max (Int64, Int64): Int64

Returns the max of a and b.

 

class method Max(a: Int64; b: Int64): Int64

 

static Int64 Max(Int64 a, Int64 b)

 

static func Max(_ a: Int64, _ b: Int64) -> Int64

 

static Int64 Max(Int64 a, Int64 b)

Parameters:

  • a:
  • b:

Min (Double, Double): Double

Returns the min of a and b.

 

class method Min(a: Double; b: Double): Double

 

static Double Min(Double a, Double b)

 

static func Min(_ a: Double, _ b: Double) -> Double

 

static Double Min(Double a, Double b)

Parameters:

  • a:
  • b:

Min (Int32, Int32): Int32

Returns the min of a and b.

 

class method Min(a: Int32; b: Int32): Int32

 

static Int32 Min(Int32 a, Int32 b)

 

static func Min(_ a: Int32, _ b: Int32) -> Int32

 

static Int32 Min(Int32 a, Int32 b)

Parameters:

  • a:
  • b:

Min (Int64, Int64): Int64

Returns the min of a and b.

 

class method Min(a: Int64; b: Int64): Int64

 

static Int64 Min(Int64 a, Int64 b)

 

static func Min(_ a: Int64, _ b: Int64) -> Int64

 

static Int64 Min(Int64 a, Int64 b)

Parameters:

  • a:
  • b:

Pow (Double, Double): Double

Returns the power of x and y: x**y

 

class method Pow(x: Double; y: Double): Double

 

static Double Pow(Double x, Double y)

 

static func Pow(_ x: Double, _ y: Double) -> Double

 

static Double Pow(Double x, Double y)

Parameters:

  • x:
  • y:

Pow (Double, Int32): Double

Returns the power of x and y: x**y

 

class method Pow(x: Double; y: Int32): Double

 

static Double Pow(Double x, Int32 y)

 

static func Pow(_ x: Double, _ y: Int32) -> Double

 

static Double Pow(Double x, Int32 y)

Parameters:

  • x:
  • y:

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Round

Round the value of a, according to bankers rounding.

 

class method Round(a: Double): Int64

 

static Int64 Round(Double a)

 

static func Round(_ a: Double) -> Int64

 

static Int64 Round(Double a)

Parameters:

  • a:

Sign

Returns the sign of d.

 

class method Sign(d: Double): Int32

 

static Int32 Sign(Double d)

 

static func Sign(_ d: Double) -> Int32

 

static Int32 Sign(Double d)

Parameters:

  • d:

Sin

Returns the sine of x.

 

class method Sin(x: Double): Double

 

static Double Sin(Double x)

 

static func Sin(_ x: Double) -> Double

 

static Double Sin(Double x)

Parameters:

  • x:

Sinh

Returns the hyperbolic sine of x.

 

class method Sinh(x: Double): Double

 

static Double Sinh(Double x)

 

static func Sinh(_ x: Double) -> Double

 

static Double Sinh(Double x)

Parameters:

  • x:

Sqrt

Returns the square root of d.

 

class method Sqrt(d: Double): Double

 

static Double Sqrt(Double d)

 

static func Sqrt(_ d: Double) -> Double

 

static Double Sqrt(Double d)

Parameters:

  • d:

Tan

Returns the tangent of d.

 

class method Tan(d: Double): Double

 

static Double Tan(Double d)

 

static func Tan(_ d: Double) -> Double

 

static Double Tan(Double d)

Parameters:

  • d:

Tanh

Returns the hyperbolic tangent of d.

 

class method Tanh(d: Double): Double

 

static Double Tanh(Double d)

 

static func Tanh(_ d: Double) -> Double

 

static Double Tanh(Double d)

Parameters:

  • d:

Truncate (Double): Double

Gets the integeral value of d.

 

class method Truncate(d: Double): Double

 

static Double Truncate(Double d)

 

static func Truncate(_ d: Double) -> Double

 

static Double Truncate(Double d)

Parameters:

  • d:

Truncate (Single): Single

Gets the integeral value of d.

 

class method Truncate(d: Single): Single

 

static Single Truncate(Single d)

 

static func Truncate(_ d: Single) -> Single

 

static Single Truncate(Single d)

Parameters:

  • d:

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

Math()

 

init()

 

Math()

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()