typeover
rust curriculum

Curriculum Foundations Scalar types exercise 5 · fill-word

Scalar types

Rust requires an explicit keyword to convert between numeric types — no implicit coercion. Fill the keyword.

TypeScript reference
Fill the blanks →

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.