X Tutup
Skip to content

[Vector4] Fix loss of precision with division#113848

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
JJCUBER:patch-2
Dec 11, 2025
Merged

[Vector4] Fix loss of precision with division#113848
Repiteo merged 1 commit intogodotengine:masterfrom
JJCUBER:patch-2

Conversation

@JJCUBER
Copy link
Contributor

@JJCUBER JJCUBER commented Dec 10, 2025

Resolves #113847

@JJCUBER JJCUBER requested a review from a team as a code owner December 10, 2025 13:57
@AThousandShips AThousandShips added this to the 4.6 milestone Dec 10, 2025
@AThousandShips
Copy link
Member

Note for the future, please don't link or reference issues or PRs in the commit message, it creates a lot of unnecessary noise in the issue (it'll add a note in the issue every time this commit is pushed)

@JJCUBER
Copy link
Contributor Author

JJCUBER commented Dec 10, 2025

Sorry about that.

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I don't expect the change from pre-division to pure division to create any real performance issues, but it does solve the precision issue which I think is more critical (this code was added when Vector4 was first added, so was not an intentional change for performance at a later time)

@JJCUBER
Copy link
Contributor Author

JJCUBER commented Dec 10, 2025

Note for the future, please don't link or reference issues or PRs in the commit message, it creates a lot of unnecessary noise in the issue (it'll add a note in the issue every time this commit is pushed)

Just to clarify so that I don't get it wrong in the future, is it fine to put it in the PR's actual body/message (not the commit message), or should I avoid it there as well?

@AThousandShips
Copy link
Member

AThousandShips commented Dec 10, 2025

Note for release management: Because it changes the exact values of the result this could technically be considered a compatibility breakage, but I'm leaving the label off for now, feel free to add it if it is considered significant, also holding off adding cherry-picking to this for the same reason

Code using is_equal_approx will not be affected by this change, but exact comparisons will (which should be avoided anyway) and serialization naturally, but I don't think it'd be a serious breakage

@AThousandShips
Copy link
Member

Please do put it in the PR description, see here

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'm guessing the previous author just thought to be clever and save lines edited. If we need divisions, we should do divisions.

@Repiteo Repiteo merged commit 49ec6b0 into godotengine:master Dec 11, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 11, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Vector4] Loss of precision with division

5 participants

X Tutup