My rust calculation code is giving me wrong result, but when I do the same in python or C/C++ it gives me correct result, here is the code -
In rust -
let mem_percent_used: u64 = (1569494 / 3915755) * 100;
println!("{}", mem_percent_used);
// outputs 0, expecting 40
In python -
print((1569494 / 3915755) * 100)
# output 40.08151684668729
even if it's a simple calculation then also it's giving wrong output.