namespace sys.core.lang
class Double
A class representing a 64 bit floating point number.
It maps exactly to a 64 bit CPU resource and has no overhead. Because of this strict mapping it can't have extra non-static member variables, can't be inherited from and can't have virtual methods.
this Saturated{value: Double};
Constructs a saturated Double based on the input value.
value | the input value. Can be numeric or a string. |
---|
def Clamp(min: Double, max: Double);
Clamps the current mutable instance between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
func Clamped(min: Double, max: Double): Double;
Returns the current instance clamped between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
the clamped value
func Pow(exp: Double): Double;
Raises the instance to an exponent.
exp | the exponent |
---|
the exponential
func ToString(): String;
Converts the value to a Utf8 string.
the resulting string
func @write(ref stream: Stream);
func @write(ref stream: Stream, format: OutputFormat);
Writes the value to an Utf8 text stream.
Can use an optional output format specifier.
stream | the output stream |
---|---|
format | formatting information |
func @put(ref stream: Stream);
Writes the value to a binary stream as a 64 bit floating point.
stream | the output stream |
---|
def @get(ref stream: Stream);
Reads a 64 bit floating point from a binary stream.
stream | the input stream |
---|
property IsNan: Bool; get;
Return true if the instance is not a number.
property IsInfinite: Bool; get;
Return true if the infinite.
property Abs: Double; get;
Returns the absolute value.
property Sqr: Double; get;
Returns the square of the value value.
property Sqrt: Double get = Math.Sqrt;
Returns the square root of the value.
property Floor: Double get = Math.Floor;
Returns the floor of a floating point value.
property Ceil: Double get = Math.Ceil;
Returns the ceiling of a floating point value.
property Round: Double get = Math.Round;
Returns the rounded value of a floating point.
property Trunc: Double get = Math.Trunc;
Returns the value truncated to the nearest integer value.
property Sin: Double get = Math.Sin;
Returns the sine of the value.
property Cos: Double get = Math.Cos;
Returns the cosine of the value.
property Tan: Double get = Math.Tan;
Returns the tangent of the value.
property Sinh: Double get = Math.Sinh;
Returns the hyperbolic sine of the value.
property Cosh: Double get = Math.Cosh;
Returns the hyperbolic cosine of the value.
property Tanh: Double get = Math.Tanh;
Returns the hyperbolic tangent of the value.
property Asin: Double get = Math.Asin;
Returns the arcsine of the value.
property Acos: Double get = Math.Acos;
Returns the arccosine of the value.
property Atan: Double get = Math.Atan;
Returns the arctangent of the value.
property Asinh: Double get = Math.Asinh;
Returns the hyperbolic arcsine of the value.
property Acosh: Double get = Math.Acosh;
Returns the hyperbolic arcsine of the value.
property Atanh: Double get = Math.Atanh;
Returns the hyperbolic arctangent of the value.
property Log: Double get = Math.Log;
Returns the natural logarithm of a value.
property Log2: Double get = Math.Log2;
Returns the base 2 logarithm of a value.
property Log10: Double get = Math.Log10;
Returns the base 10 logarithm of a value.
const Zero: Double;
A Double instance representing a logical "0" value.
const One: Double;
A Double instance representing a logical "1" value.
const Min: Double;
The minimum value for a Double (64 bit floating point) instance.
const Max: Double;
The maximum value for a Double (64 bit floating point) instance.
const IsSigned;
Returns true if the floating point representation is signed.
const IsInteger;
Returns false.
const MaxDigitsLow;
The lower limit for the number of base 10 digits that are needed to represent a maximal value in textual form.
In base 10, you can have MaxDigitsLow digits that go though values 0-9.
Should not be used for buffer sizes.
const MaxDigitsHigh;
The upper limit for the number of base 10 digits that are needed to represent a maximal value in textual form.
In base 10, the `MaxDigitsHigh - MaxDigitsLow` most significant digits can't go though values 0-9 because they do not fit the binary representation.
Should not be used for buffer sizes.
const MinExpBase10;
The minimum base 10 exponent.
const MaxExpBase10;
The maximum base 10 exponent.
const Nan;
The not a number value.
const Infinite;
Positive infinite.