gpujs / gpu.js

GPU Accelerated JavaScript
https://gpu.rocks
MIT License
15.08k stars 650 forks source link

Problem with Math.pow on mobile #704

Open AnzeBlaBla opened 3 years ago

AnzeBlaBla commented 3 years ago

A GIF or MEME to give some spice of the internet

What is wrong?

The Math.pow function returns unexpected results on mobile. I'm using it for sorting distances for drawing to a canvas (so it's in a graphical kernel function)

Where does it happen?

Math.pow(this.thread.x - [some other x coordinate], 2) on my Xiaomi Mi Note 10 Lite in Chrome

How do we replicate the issue?

I created a jsfiddle example which works for me on pc, but not on mobile https://jsfiddle.net/khyqw7nr/14/

How important is this (1-5)?

1 - I just multiplied the value by itself and it worked, just seems like an unusual issue

Expected behavior (i.e. solution)

Other Comments

I know this is a bad way to use the function, but it should still work