std/jule/types
Globals
static BitSize: int
Bit-size of target architecture.
Possible values are: 32, and 64.
static SysInt: str
Signed integer kind of target architecture.
Is equavalent to int
, but specific bit-sized integer kind.
static SysUint: str
Unsigned integer kind of target architecture.
Is equavalent to uint
and uintptr
, but specific bit-sized integer kind.
MaxF32
Maximum positive value of 32-bit floating-points.
MinF32
Maximum negative value of 32-bit floating-points.
MaxF64
Maximum positive value of 64-bit floating-points.
MinF64
Maximum negative value of 64-bit floating-points.
MaxI8
Maximum positive value of 8-bit signed integers.
MinI8
Maximum negative value of 8-bit signed integers.
MaxI16
Maximum positive value of 16-bit signed integers.
MinI16
Maximum negative value of 16-bit signed integers.
MaxI32
Maximum positive value of 32-bit signed integers.
MinI32
Maximum negative value of 32-bit signed integers.
MaxI64
Maximum positive value of 64-bit signed integers.
MinI64
Maximum negative value of 64-bit signed integers.
MaxU8
Maximum value of 8-bit unsigned integers.
MaxU16
Maximum value of 16-bit unsigned integers.
MaxU32
Maximum value of 32-bit unsigned integers.
MaxU64
Maximum value of 64-bit unsigned integers.
Functions
fn UpdateTarget()
Updates platform-specific informations by target. If you will update target configuration, you should call this function. In other words, new configurations is not applied for types.
fn RealKindOf(kind: str): str
Returns kind's bit-specific kind if bit-specific like int, uint, and uintptr.
Returns kind if not bit-specific.
Bit-size is determined by runtime.
fn BitSizeOf(k: str): int
Returns kind's bit-size.
Returns -1 if kind is not numeric.
fn IntFromBits(bits: int): str
Returns signed integer kind by bit-size.
Possible bit-sizes are: 8, 16, 32, and 64.
Returns empty string if bits is invalid.
fn UintFromBits(bits: int): str
Returns unsigned integer kind by bit-size.
Possible bit-sizes are: 8, 16, 32, and 64.
Returns empty string if bits is invalid.
fn FloatFromVits(bits: int): str
Returns floating-point kind by bit-size.
Possible bit-sizes are: 32, and 64.
Returns empty string if bits is invalid.
fn CheckBitInt(v: str, bit: int): bool
Reports whether signed integer literal is compatible given bit-size.
fn CheckBitUint(v: str, bit: int): bool
Reports whether unsigned integer literal is compatible given bit-size.
fn CheckBitFloat(val: str, bit: int): bool
Reports whether float literal is compatible given bit-size.
fn BitSizeOfFloat(x: f64): int
Reports minimum bit-size of given floating-point.
Possible values are:
- 32 for 32-bit
- 64 for 64-bit
fn BitSizeOfInt(x: i64): int
Reports minimum bit-size of given signed integer.
Possible values are:
- 8 for 8-bit
- 16 for 16-bit
- 32 for 32-bit
- 64 for 64-bit
fn BitSizeOfUint(x: u64): int
Reports minimum bit-size of given unsigned integer.
Possible values are:
- 8 for 8-bit
- 16 for 16-bit
- 32 for 32-bit
- 64 for 64-bit
fn Min(mut k: str): f64
Returns minimum value of signed/unsigned integer and floating-point kinds. Returns 0 if kind is invalid.
fn Max(mut k: str): f64
Returns maximum value of signed/unsigned integer and floating-point kinds. Returns 0 if kind is invalid.
fn MaxU(mut k: str): u64
Returns maximum value of unsigned integer kinds. Returns 0 if kind is invalid.
fn MaxI(mut k: str): i64
Returns minimum value of signed integer kinds. Returns 0 if kind is invalid.
fn MinI(mut k: str): i64
Returns minimum value of signed integer kinds. Returns 0 if kind iss invalid.
fn IsSigInt(mut k: str): bool
Reports whether kind is signed integer.
fn IsUnsigInt(mut k: str): bool
Reports kind is unsigned integer.
fn IsInt(k: str): bool
Reports whether kind is signed/unsigned integer.
fn IsFloat(k: str): bool
Reports whether kind is float.
fn IsNum(k: str): bool
Reports whether kind is numeric.
fn IsSigNum(k: str): bool
Reports whether kind is signed numeric.
Enums
enum Kind: str
Type kinds of primitive types. These kinds are must match keyword form itself.
Fields:
I8
: Kind of signed 8-bit integerI16
: Kind of signed 16-bit integerI32
: Kind of signed 32-bit integerI64
: Kind of signed 64-bit integerU8
: Kind of unsigned 8-bit integerU16
: Kind of unsigned 16-bit integerU32
: Kind of unsigned 32-bit integerU64
: Kind of unsigned 64-bit integerF32
: Kind of 32-bit floating-pointF64
: Kind of 64-bit floating-pointUint
: Kind of system specific bit-size unsigned integerInt
: Kind of system specific bit-size signed integerUintptr
: Kind of system specific bit-size unsigned integerBool
: Kind of booleanStr
: Kind of stringAny
: Kind of any type