fix: [ASAN] devive by zero
This commit is contained in:
parent
2bdb86e287
commit
4f176e325d
|
@ -24,6 +24,8 @@ static double tlog2(double v, double base) {
|
||||||
return a;
|
return a;
|
||||||
} else if (isnan(b) || isinf(b)) {
|
} else if (isnan(b) || isinf(b)) {
|
||||||
return b;
|
return b;
|
||||||
|
} else if (b == 0) {
|
||||||
|
return INFINITY;
|
||||||
} else {
|
} else {
|
||||||
return a / b;
|
return a / b;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue