Casts

#import Builtin:Casts;

A builtin module defining casts between all of the builtin types

Functions


float(int)

cast:: float(x : int) 

Converts an int to float

float(char)

cast:: float(x : char) 

Converts a char to float

float(float)

cast:: float(x : float) 

Identity cast for float

float(double)

cast:: float(x : double) 

Converts a double to float

float(bool)

cast:: float(x : bool) 

Converts a bool to float

double(char)

cast:: double(x : char) 

Converts a char to double

double(float)

cast:: double(x : float) 

Converts a float to double

double(double)

cast:: double(x : double) 

Identity cast for double

double(bool)

cast:: double(x : bool) 

Converts a bool to double

int(float)

cast:: int(x : float) 

Converts a float to int, truncating decimal portion

int(double)

cast:: int(x : double) 

Converts a double to int, truncating decimal portion

int(int)

cast:: int(x : int) 

Identity cast for int

int(uint)

cast:: int(x : uint) 

Converts an unsigned int to signed int

int(bool)

cast:: int(x : bool) 

Converts a bool to int

uint(float)

cast:: uint(x : float) 

Converts a float to unsigned int, truncating decimal portion

uint(double)

cast:: uint(x : double) 

Converts a double to unsigned int, truncating decimal portion

uint(int)

cast:: uint(x : int) 

Converts a signed int to unsigned int

uint(uint)

cast:: uint(x : uint) 

uint(bool)

cast:: uint(x : bool) 

Converts a bool to unsigned int

uint64(float)

cast:: uint64(x : float) 

Converts a float to 64-bit unsigned int

uint64(double)

cast:: uint64(x : double) 

Converts a double to 64-bit unsigned int

uint64(int)

cast:: uint64(x : int) 

Converts an int to 64-bit unsigned int

uint64(uint)

cast:: uint64(x : uint) 

Converts an unsigned int to 64-bit unsigned int

uint64(bool)

cast:: uint64(x : bool) 

Converts a bool to 64-bit unsigned int

int64(float)

cast:: int64(x : float) 

Converts a float to 64-bit signed int

int64(double)

cast:: int64(x : double) 

Converts a double to 64-bit signed int

int64(int)

cast:: int64(x : int) 

Converts an int to 64-bit signed int

int64(uint)

cast:: int64(x : uint) 

Converts an unsigned int to 64-bit signed int

int64(bool)

cast:: int64(x : bool) 

Converts a bool to 64-bit signed int

uint16(float)

cast:: uint16(x : float) 

Converts a float to 16-bit unsigned int

uint16(double)

cast:: uint16(x : double) 

Converts a double to 16-bit unsigned int

uint16(int)

cast:: uint16(x : int) 

Converts an int to 16-bit unsigned int

uint16(uint)

cast:: uint16(x : uint) 

Converts an unsigned int to 16-bit unsigned int

uint16(bool)

cast:: uint16(x : bool) 

Converts a bool to 16-bit unsigned int