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

refactor and extraction #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

refactor and extraction #16

wants to merge 3 commits into from

Conversation

hakonxxx
Copy link

@hakonxxx hakonxxx commented Jun 13, 2024

aim to improve performance

refactor:

  1. split fractionConfig

change:

  1. remove fraction.expandDecimals/fraction.normalizeDecimals/Fraction.ZERO/Fraction.ONE
  2. sign always place at numerator no matter where it`s original place
  3. add class FractionPureData/FractionData to represent a fraction, FractionData support parse/simplify
  4. add class FractionHelper to do calculation(static methods) and format(instance methods)
  5. replace implementation of Fraction with FractionHelper
  6. all operations return new instance no matter if the value is same as previous one
  7. support pow operation (only integer exponent)

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.

None yet

1 participant