fix: should be a float...

This commit is contained in:
əlemi 2023-11-18 04:55:35 +01:00
parent acc8824600
commit 2d5ab36f67
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -34,7 +34,7 @@ fn main() {
pool.reserve(sum as usize); pool.reserve(sum as usize);
for (count, line) in lines { for (count, line) in lines {
for _ in 0..count { for _ in 0..count {
pool.push((line, count / sum)); pool.push((line, count as f32 / sum as f32));
} }
} }
@ -42,5 +42,5 @@ fn main() {
println!("Content-type: application/json"); println!("Content-type: application/json");
println!(); println!();
println!("{{\"id\":{},\"mood\":\"{}\",\"chance\":{}}}", index, choice, chance); println!("{{\"id\":{},\"mood\":\"{}\",\"chance\":{:.3}}}", index, choice, chance);
} }