RosettaCodeData/Task/Literals-Floating-point/Rust/literals-floating-point.rs
2024-10-16 18:07:41 -07:00

4 lines
295 B
Rust

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.