V supports a wide range of primitive types. Below is a list of all supported primitive types:
Unlike C and Go,
intis always a 32-bit integer.
There is an exception to the rule that all operators in V must have values of the same type on both sides. A small primitive type on one side can be automatically promoted if it fits completely into the data range of the type on the other side.
These are the allowed possibilities:
int value for example can be automatically promoted to
i64 but not to
u32 would mean loss of the sign for
f32, however, is currently done automatically
(but can lead to precision loss for large values).
4.56 are treated in a special way. They do
not lead to type promotions, however they default to
respectively, when their type has to be decided: