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

fix float.eq()

This commit is contained in:
Alexander Medvednikov 2019-10-15 03:45:11 +03:00
parent 91690a1b54
commit 10ed65bc12

View File

@ -43,10 +43,10 @@ pub fn (a f32) eq(b f32) bool {
$if tinyc { $if tinyc {
return a -b <= 0.01 return a -b <= 0.01
} $else { } $else {
return C.fabs(a - b) <= C.DBL_EPSILON return C.fabsf(a - b) <= C.FLT_EPSILON
} }
} $else { } $else {
return C.fabs(a - b) <= C.DBL_EPSILON return C.fabsf(a - b) <= C.FLT_EPSILON
} }
} }
pub fn (a f64) eqbit(b f64) bool { pub fn (a f64) eqbit(b f64) bool {