fix float.eq()
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