namespace sys.core.lang
class QWord
A class representing a 64 bit unsigned integer.
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{string: String};
Parses a string an constructs a QWord based on it.
string | string to parse |
---|
this Saturated{value: Long};
this Saturated{value: QWord};
this Saturated{value: String};
Constructs a saturated QWord based on the input value.
value | the input value. Can be numeric or a string. |
---|
def Clamp(min: QWord, max: QWord);
Clamps the current mutable instance between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
func Clamped(min: QWord, max: QWord): QWord;
Returns the current instance clamped between `min` and `max`.
min | the minimum value |
---|---|
max | the maximum value |
the clamped value
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 unsigned integer.
stream | the output stream |
---|
def @get(ref stream: Stream);
Reads a 64 bit unsigned integer from a binary stream.
stream | the input stream |
---|
property Abs: QWord; get;
Returns the absolute value.
In the case of QWord it returns the value itself and is included only for API compatibility when using templates.
property Sqr: QWord; get;
Returns the square of the value value.
property Sqrt: QWord; get;
Returns the square root of the value, rounded down.
property Floor: QWord; get;
Returns the floor of a floating point value.
In the case of QWord it returns the value itself and is included only for API compatibility when using templates.
property Ceil: QWord; get;
Returns the ceiling of a floating point value.
In the case of QWord it returns the value itself and is included only for API compatibility when using templates.
property Round: QWord; get;
Returns the rounded value of a floating point.
In the case of QWord it returns the value itself and is included only for API compatibility when using templates.
property Trunc: QWord; get;
Returns the value truncated to the nearest integer value.
In the case of QWord it returns the value itself and is included only for API compatibility when using templates.
const Zero: QWord;
A QWord instance representing a logical "0" value.
const One: QWord;
A QWord instance representing a logical "1" value.
const Min: QWord;
The minimum value for a QWord (64 bit unsigned integer) instance.
const Max: QWord;
The maximum value for a QWord (64 bit unsigned integer) instance.
const IsSigned;
true if the numeric representation uses two's complement signed values, false otherwise.
const IsInteger;
true if the numeric representation is an integer, false if it is a floating point.
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 through 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 through values 0-9 because they do not fit the binary representation.
Should not be used for buffer sizes.