Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathEx.UFraction32 with big error? #99

Open
FSofTlpz opened this issue Jun 22, 2022 · 0 comments
Open

MathEx.UFraction32 with big error? #99

FSofTlpz opened this issue Jun 22, 2022 · 0 comments

Comments

@FSofTlpz
Copy link

I have found in real coordinates a MathEx.UFraction32 with numerator = 29964 and denominator = 3125. This is 9.58848.

But if create a MathEx.UFraction32 with v = new MathEx.UFraction32(9.58848), v has the nominator = 48 and the denominator 5. This is 9.6. The difference is to hight for me. Is there no way to get a better v?

For this time i use my own simple Function:

      MathEx.UFraction32 getUFraction32ForFloat(float f) {
         uint numerator = (uint)(f * 100000000);
         uint denominator = 100000000;
         while (numerator == (numerator / 10) * 10) {
            numerator /= 10;
            denominator /= 10;
         }
         return new MathEx.UFraction32(numerator, denominator);
      }

RudyTheDev added a commit to RudyTheDev/exiflibrary that referenced this issue Aug 10, 2022
…nd have GPSLatitudeLongitude use doubles to preserve coordinate accuracy when writing fractional second values. This fixes oozcitak#103 and presumably the cause oozcitak#99.
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

No branches or pull requests

1 participant