typeover
rust curriculum

Curriculum Foundations Scalar types exercise 2 · mcq

Scalar types

Pick the idiomatic Rust binding for a fractional number. Rust's default float is the 64-bit form, not the 32-bit one.

TypeScript reference
Pick the idiomatic Go translation

About this theme

TypeScript gives beginners one number; Rust asks what number you mean. This theme introduces signed and unsigned integers, usize, f32 and f64, bool, char, explicit casts with as, and the lack of implicit numeric conversion. Planned exercises: 1. choose i32 for an integer. 2. choose f64 for a float. 3. recognise usize for indexes and lengths. 4. fill a boolean type. 5. fill a cast. 6. write an annotated numeric binding. 7. write a safe length comparison. 8. translate TS numeric code with explicit Rust types. 9. fix a mixed-integer compile error.