1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: restrict numeric promotions to cases where no data is lost

This commit is contained in:
Uwe Krüger
2020-05-27 05:42:48 +02:00
committed by GitHub
parent fc67046bac
commit 013fdb8a4b
81 changed files with 510 additions and 247 deletions

View File

@ -65,6 +65,6 @@ pub fn dice_coefficient(s1, s2 string) f32 {
intersection_size++
}
}
return (2.0 * intersection_size) / (f32(a.len) + f32(b.len) - 2)
return (2.0 * f32(intersection_size)) / (f32(a.len) + f32(b.len) - 2)
}