float
, f32
and f64
are defined in the Rust manual: http://static.rust-lang.org/doc/0.8/rust.html#primitive-types
Specifically, for float
:
The Rust type float is a machine-specific type equal to one of the
supported Rust floating-point machine types (f32 or f64). It is the
largest floating-point type that is directly supported by hardware on
the target machine, or if the target machine has no floating-point
hardware support, the largest floating-point type supported by the
software floating-point library used to support the other
floating-point machine types.
So float
is not 16-bits, it's an alias for either f32
or f64
, depending on the hardware.
To answer the second part of your question, in a low-language level like Rust, one can not simply postulate that a float is 64-bits, because if the hardware does not support this kind of floats natively then there is a significant performance penalty. One can neither have a single float type with an unspecified representation, because for a lot of use cases one need to have guarantees on the precision of the manipulated numbers.
In general, you would use float
in the general case, and f32
or f64
when you have specific needs.
Edit: float
has now been removed from the language, and there are only f32
and f64
float types now. The point being that all current architectures support 64-bits floats now, so float
was always f64
, and no use case were found for a machine-specific type.