First published at 05:03 UTC on December 21st, 2017.
This video was re uploaded because in the original my seal
covered the video about half way through and on.
This is the fifth video on learning rust together. Today we
touched on data types. I left out the min and max, because that
is your guys hom…
MORE
This video was re uploaded because in the original my seal
covered the video about half way through and on.
This is the fifth video on learning rust together. Today we
touched on data types. I left out the min and max, because that
is your guys homework in a way. In the next video I'll show that.
As always here is the link to the rust book for more reading.
https://doc.rust-lang.org/book/second-edition/ch03-02-data-types.html
Scalar Types: Integers, floating-point, Boolean and characters
Integers:
Length | Singed | Unsigned
-------+--------+---------
8-bit | i8 | u8
16-bit | i16 | u16
32-bit | i32 | u32
64-bit | i64 | u64
arch | isize | usize
# Literals | Example
-----------+--------
Decimal | 92_222
Hex | 0xff
Octal | 0o77
Binary | 0b1111_0000
Byte (u8) | b'A'
example i8 = -128 to 127
example u8 = 0 - 255
Floats:
32 bit and 64 bit
let x = 2.0 // f64
let y: f32 = 3.0 //f32
Char:
U+0000 - U+D7FF and U+E000 - U+10FFFF
println!("東京");
LESS