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

add func & test for getting numerator & denominator of fixed point decimal number #57

Closed
wants to merge 1 commit into from

Conversation

michiboo
Copy link

Address issues #56

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.531% when pulling b72a32b on michiboo:den_num into e8c9f3b on JuliaMath:master.

@NHDaly
Copy link
Member

NHDaly commented Feb 18, 2022

This seems nice to me. Thanks for the PR! Many apologies for our very long delay.

It's probably worth considering whether there could be a more performant way to do this..

For example, we could start by constructing the rational via Rational(x.i, coefficient(FD{T, f})), and then take its num and dec. I think that would probably be more performant, since it avoids unnecessarily converting to a Float in between?

    return Rational(x.i, coefficient(FD{T, f})).num

Something like that, i think, anyway.

Copy link
Member

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

That said, i'm happy to merge like this if we want to, as well

This pull request was closed.
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.

3 participants