namespace sys.core.lang
class Byte
this{string: String};
Parses a string an constructs a Byte based on it.
string=> string to parse
this Saturated{value: Int};
this Saturated{value: DWord};
this Saturated{value: Long};
this Saturated{value: QWord};
this Saturated{value: Double};
this Saturated{value: String};
Constructs a saturated Byte based on the input value.
value=> the input value. Can be numeric or a string.
def Clamp(min: Byte, max: Byte);
Clamps the current mutable instance between `min` and `max`.
min=> the minimum value
max=> the maximum value
func Clamped(min: Byte, max: Byte): Byte;
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 8 bit unsigned integer.
stream=> the output stream
def @get(ref stream: Stream);
Reads a 8 bit unsigned integer from a binary stream.
stream=> the input stream
property Abs: Byte; get;
Returns the absolute value. In the case of Byte it returns the value itself and is included only for API compatibility when using templates.
property Sqr: Byte; get;
Returns the square of the value value.
property Sqrt: Byte; get;
Returns the square root of the value, rounded down.
property Floor: Byte; get;
Returns the floor of a floating point value. In the case of Byte it returns the value itself and is included only for API compatibility when using templates.
property Ceil: Byte; get;
Returns the ceiling of a floating point value. In the case of Byte it returns the value itself and is included only for API compatibility when using templates.
property Round: Byte; get;
Returns the rounded value of a floating point. In the case of Byte it returns the value itself and is included only for API compatibility when using templates.
property Trunc: Byte; get;
Returns the value truncated to the nearest integer value. In the case of Byte it returns the value itself and is included only for API compatibility when using templates.
const Zero: Byte;
A Byte instance representing a logical "0" value.
const One: Byte;
A Byte instance representing a logical "1" value.
const Min: Byte;
The minimum value for a Byte (8 bit unsigned integer) instance.
const Max: Byte;
The maximum value for a Byte (8 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.