Fix divWithIntCheck for floats larger than max int by rotu · Pull Request #723 · gpujs/gpu.js
Expand Up
@@ -1086,7 +1086,7 @@ class WebGLKernel extends GLKernel {
_getDivideWithIntegerCheckString() {
return this.fixIntegerDivisionAccuracy ?
`float divWithIntCheck(float x, float y) {
if (floor(x) == x && floor(y) == y && integerMod(x, y) == 0.0) {
if (int(x) == x && int(y) == y && integerMod(x, y) == 0.0) {
return float(int(x) / int(y));
}
return x / y;
Expand Down
Expand Up
@@ -1604,4 +1604,4 @@ float integerCorrectionModulo(float number, float divisor) {
module.exports = { WebGLKernel }; };
module.exports = { WebGLKernel }; };