RUST

Typy dany

Liczby całkowite

`i8` // `(-2^7)..=(2^7 -1)`

`u8` // `0..=(2^8 -1)`

`i16` // `(-2^15)..=(2^15 -1)`

`u16` // `0..=(2^16 -1)`

`i32` // `(-2^31)..=(2^31 -1)`

`u32` // `0..=(2^32 -1)`

`i64` // `(-2^63)..=(2^63 -1)`

`u64` // `0..=(2^64 -1)`

`i128` // `(-2^127)..=(2^127 -1)`

`u128` // `0..=(2^128 -1)`

fn main() {

    // Signed integer type 

    let x: i32 = -200;

    let y: u32 = 200;

    println!("x = {}", x);

    println!("y = {}", y);

}

Liczby zmiennoprzecinkowe

`f32` //  

`f63` //  

fn main() {

    // f32 floating point type

    let x: f32 = 3.1;

    // f64 floating point type

    let y: f64 = 45.0000031;

    println!("x = {}", x);

    println!("y = {}", y);

}

Prawda <--> Fałsz

`bool` // true || false

fn main() {

    // boolean type

    let flag1: bool = true;

    let flag2: bool = false;

    println!("flag1 = {}", flag1);

    println!("flag2 = {}", flag2);

}

Pojedynczy znak. np specjalny

`char` // 

fn main() {

    // char type

    let character: char = 'z';

    let special_character: char = '$';

    let numeric_character: char = '5';

    println!("character = {}", character);

    println!("special_character = {}", special_character);

    println!("numeric_character = {}", numeric_character);

}