Skip to content

Fix divWithIntCheck for floats larger than max int#723

Closed
rotu wants to merge 1 commit into
gpujs:developfrom
rotu:patch-1
Closed

Fix divWithIntCheck for floats larger than max int#723
rotu wants to merge 1 commit into
gpujs:developfrom
rotu:patch-1

Conversation

@rotu

@rotu rotu commented Oct 27, 2021

Copy link
Copy Markdown

The integer accuracy fix could previously return a wrong result when its operands were bigger than max int.

The integer accuracy fix could previously return a wrong result when its operands were bigger than max int.
@fuzzie360

Copy link
Copy Markdown
Member

Closing as superseded: the divWithIntCheck rewrite in 2.19.0 (for #742) removed the int() casts entirely — the divisibility check now rounds the quotient and verifies by exact float multiplication, so the out-of-range undefined behavior this PR targeted no longer exists. (As a side note, int(x) == x would not compile on GLSL ES 1.00 — no implicit int→float comparison — so this needed a different shape anyway.) Thanks for flagging the UB.

@fuzzie360 fuzzie360 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants