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:
parent
91690a1b54
commit
10ed65bc12
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user