-
Notifications
You must be signed in to change notification settings - Fork 67
Numeric Type
Jeremie Rossignol edited this page Dec 6, 2018
·
9 revisions
The numeric data types include types such as int
, short
, float
and double
. For this section, they are together referred to as numeric
.
Local Functions
Function Signature | Description |
---|---|
numeric Random()
|
Returns a random number that is greater than or equal to 0.0, but less than 1.0. Note for integer types this will always return 0 - use the second interface instead. |
numeric Random( numeric min, numeric max)
|
Returns a random number that is greater than or equal to min, but less than max. |
numeric Min( numeric a, numeric b)
|
Returns whichever is smallest out of a and b . |
numeric Max( numeric a, numeric b)
|
Returns whichever is largest out of a and b . |
numeric Pow( numeric a, numeric b)
|
Returns a to the power of b. |
numeric Log( numeric a, numeric b)
|
Returns the logarithm of a in base b. |
numeric Round( numeric value)
|
Rounds the number to the nearest full integer value (uses bankers rounding). |
numeric Round( numeric value, numeric precision)
|
Rounds the number to the nearest multiple of precision . For example Round(113.0, 5.0) would return 115.0 . |
numeric Sin( numeric a)
|
Calculates the sine of the angle specified in radians. |
numeric Cos( numeric a)
|
Calculates the cosine of the angle specified in radians. |
numeric Tan( numeric a)
|
Calculates the tangent of the angle specified in radians. |
numeric Asin( numeric a)
|
Calculates the arcsine of the angle specified in radians. |
numeric Acos( numeric a)
|
Calculates the arccosine of the angle specified in radians. |
numeric Atan( numeric a)
|
Calculates the arctangent of the angle specified in radians. |
numeric Sinh( numeric a)
|
Calculates the hyperbolic sine of the angle specified in radians. |
numeric Cosh( numeric a)
|
Calculates the hyperbolic cosine of the angle specified in radians. |
numeric Tanh( numeric a)
|
Calculates the hyperbolic tangent of the angle specified in radians. |
Global Functions
Function Signature | Description |
---|---|
int int( numeric val)
|
Converts the value to an integer representation. |
long long( numeric val)
|
Converts the value to a long integer representation. |
uint uint( numeric val)
|
Converts the value to an unsigned integer representation. |
ulong ulong( numeric val)
|
Converts the value to an unsigned long integer representation. |
float float( numeric val)
|
Converts the value to a float (single precision) representation. |
double double( numeric val)
|
Converts the value to a float (double precision) representation. |
Methods
Method Signature | Description |
---|---|
string Print()
|
Returns the pretty-printed string value of the number, using the following rules:
|
string ToString( string format)
|
Converts to a string using the given C# format expression. |
- General Types
- KSP Types
- Contract Configurator Objects
- Other
- Global Functions
Contract Configurator
Configuration File Syntax
Extending Contract Configurator