Compare commits

..

No commits in common. "main" and "v0.0.1" have entirely different histories.
main ... v0.0.1

4 changed files with 0 additions and 66 deletions

View File

@ -1 +0,0 @@
/target

7
datatypes/Cargo.lock generated
View File

@ -1,7 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "datatypes"
version = "0.1.0"

View File

@ -1,6 +0,0 @@
[package]
name = "datatypes"
version = "0.1.0"
edition = "2024"
[dependencies]

View File

@ -1,52 +0,0 @@
fn main() {
println!("
Rust is a statically typed language.
There are 2 subsets of datatypes: scalar and compound.
1/ Scalar types
Scalar types represents a single value.
Rust has: integers, floating-point numbers,
Boolean and characters
1.1/ integers can be signed or unsigned and
size from 8 bits to 128 bits,
or have a size depending of the arch.
Default type is i32.
i8 ranges from -(2) to 2 - 1, ie -128 to 127
let x: u32 = 3000;
let x: i32 = -230_000; // equals -230000
let x: u16 = 0xff; // hexa form for 255
let x: usize = 0b1111_0000; // binary form
let x: u8 = b'A'; // byte form only u8
1.2/ Floating-point types can be f32 or f64,
default to f64:
let x = 2.0; // f64
let x: f32 = 3.0; // f32
Support basic mathematical operations:
let sum = 3.4 + 5.6;
let difference = 90_000 - 289;
let product = 4 * 30;
let quotient = 56.7 / 32.2;
let truncated = -5 / 3;
let remainder = 43 % 5;
1.3/ Boolean:
let t: bool = true;
1.4/ A `char` is 4 bytes in rust and covers unicode:
let mut c: char = 'z' // note the single quote
c = '🤗'
");
}