Skip to content

Fix Fixed64 operators#47

Closed
ArthurRibeirox wants to merge 1 commit intomrdav30:mainfrom
ArthurRibeirox:main
Closed

Fix Fixed64 operators#47
ArthurRibeirox wants to merge 1 commit intomrdav30:mainfrom
ArthurRibeirox:main

Conversation

@ArthurRibeirox
Copy link
Copy Markdown
Contributor

Hello, I'm still learning about Fixed math, but from what I understand some of the operators of Fixed64 are wrong.
They are converting Fixed64 to double, performing the operation, then back to Fixed64, there are 3 possible non-deterministic operations right?

I changed so every operator converts all to Fixed64 and perform the operations on that class.

Some tests had to be changed to FuzzyEqual, and I'm not particularly happy about the FixedQuaternion_ToEulerAngles_HandlesGimbalLockPitch, but did not know if there was some explicit handling of that case I was not aware of.

Let me know if there is anything else I need to change!

@mrdav30
Copy link
Copy Markdown
Owner

mrdav30 commented Apr 13, 2026

@ArthurRibeirox Thanks again for putting this together — you were absolutely right to call out the use of double-based math in some of the operators. That’s something I want to eliminate to keep everything fully deterministic, so great catch 👍

I’m actually planning to mark the float operators as obsolete and move them into a later breaking release.

Before I merge this in, could you retarget the PR from main → dev?

Once that’s done, I’ll pull it in and apply a few follow-up tweaks (mainly around consistency across operators and tightening up a couple edge cases).

Really appreciate you taking the time to dig into this — solid contribution.

@ArthurRibeirox
Copy link
Copy Markdown
Contributor Author

Yes, my first idea was to remove the operators, these conversions should always be explicit.
I don't know how to retarget the PR so I created a new one haha

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