RosettaCodeData/Task/Literals-Floating-point/Rust/literals-floating-point.rust

5 lines
295 B
Plaintext

2.3 // Normal floating point literal
3. // Equivalent to 3.0 (3 would be interpreted as an integer)
2f64 // The type (in this case f64, a 64-bit floating point number) may be appended to the value
1_000.2_f32 // Underscores may appear anywhere in the number for clarity.