There are no implicit conversions in F# as conversions have to be done manually using conversion routines. Conversion must be made explicitly between types using the operators that are described in the following table:
Operator |
Example |
Description |
---|---|---|
byte |
byte x |
Overloaded conversion to a byte |
sbyte |
sbyte x |
Overloaded conversion to a signed byte |
int16 |
int16 |
Overloaded conversion to a 16-bit integer |
uint16 |
uint16 |
Overloaded conversion to an unsigned 16-bit integer |
int32, int |
Int32 x, int x |
Overloaded conversion to a 32-bit integer |
uint32 |
uint32 x |
Overloaded conversion to an unsigned 32-bit integer |
int64 |
int64 x |
Overloaded conversion to a 64-bit integer |
uint64 |
uint64 x |
Overloaded conversion to an unsigned 64-bit integer |
nativeint |
nativeint x |
Overloaded conversion to a native integer |
unativeint |
unativeint x |
Overloaded conversion to an unsigned native integer |
float, double |
float x, double x |
Overloaded conversion to a 64-bit IEEE floating-point... |