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

Figure out a good convention for normalizing rational numbers #5738

Closed
thestinger opened this issue Apr 5, 2013 · 5 comments
Closed

Figure out a good convention for normalizing rational numbers #5738

thestinger opened this issue Apr 5, 2013 · 5 comments

Comments

@thestinger
Copy link
Contributor

The gmp Mpq type does does it after each operation, and then exposes a raw interface for doing a few operations without normalizing. It only guarantees that operations are valid when the type is normalized. This leads to the most predictable performance with big integers, and avoids avoidable overflows for fixed size ones.

This would probably involve making the fields priv and using scary names for raw manipulation methods.

@pnkfelix
Copy link
Member

Visited for bug triage, 2013jun24. The title of this bug makes this sound like a potentially open-ended task, but I interpret the description as being in favor of normalizing (by force, by doing it behind an enforced abstraction layer) after each operation (or at least all the standard arithmetic operations, in order to get predictable performance).

@huonw
Copy link
Member

huonw commented Sep 23, 2013

Triage: I'd agree with the description of normalising like GMP (after every operation) and exposing some low-level methods for when someone wants the library to trust them (maybe even making these unsafe?).

(Part of #4819, related to #8466.)

@flaper87
Copy link
Contributor

Visiting for triage. @bjz may have more to add here.

(part of #10387)

@rust-highfive
Copy link
Collaborator

This issue has been moved to the RFCs repo: rust-lang/rfcs#332

@rust-highfive
Copy link
Collaborator

This issue has been moved to the RFCs repo: rust-num/num#6

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 23, 2020
Improve end of expression check in for loop lints

changelog: none
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

6 participants