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

Should Fraction be stored as a mixed number? #5

Open
LemmaEOF opened this issue May 25, 2020 · 5 comments
Open

Should Fraction be stored as a mixed number? #5

LemmaEOF opened this issue May 25, 2020 · 5 comments

Comments

@LemmaEOF
Copy link
Contributor

Not much else to say, really. We're just deciding whether to:

  • store just long numerator and long denominator as we are right now
  • store int whole, int numerator, and int denominator
  • store int whole, long numerator, and long denominator
@shedaniel
Copy link

I don’t really have a preference, would go for one that can be optimised to be faster though.

@Prospector
Copy link

I think 3 ints should be enough. With wholes split off numerators should never be too high.

@LemmaEOF
Copy link
Contributor Author

yeah, and though Alex did worry that LCMs might get too big for an int, that's why we simplify on every op. The worst LCM I can think of reasonably happening is 81,000 (LCM of 1,000 and 81, which is also a multiple of 3, 4, 5, 6, 8, 9, 10, 12, and most other common units folks would want).

@kvverti
Copy link

kvverti commented May 25, 2020

Sounds good to me too. At least have the person who makes the changes document all the decisions.

@Vonr
Copy link

Vonr commented Sep 10, 2020

should whole be stored as a long/biginteger so that it can store more fluid?

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

5 participants