f32 example

This commit is contained in:
Mert Gör ☭ 2024-01-08 16:14:24 +03:00
parent 9e19a213bc
commit 949c25bb2d
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F
1 changed files with 4 additions and 0 deletions

View File

@ -35,4 +35,8 @@ fn main() {
let g:char = 'g'; // _,;+%'!? can be char
println!("g = {} and it's size {}", g,mem::size_of_val(&g));
// f32 or f64 can't be u , it is signed by default IEEE754 ile none, can be assigned +- infinite values
let h:f32 = 2.00000000005;
println!("h = {} and it's size {}", h,mem::size_of_val(&h));
}