Skip to content

Assorted changes to numerics, including the addition of floating-point encoding/decoding methods #6094

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

Closed
wants to merge 6 commits into from

Conversation

brendanzab
Copy link
Member

This is part of the numeric trait reform (see issue #4819).

I have included the following methods to the Float trait:

fn encode(sig: Self, exp: int) -> Self;
fn decode(&self) -> (Self, int);
fn significand(&self) -> Self;
fn exponent(&self) -> int;

The following methods have been removed from the Real trait, because they are specific to floating-point numbers and also because their functionality is covered by the methods mentioned above:

fn ldexp(&self, n: int) -> Self;
fn log_radix(&self) -> Self;
fn ilog_radix(&self) -> int;

The Integer::divisible_by method has been renamed to Integer::is_multiple_of.

@brendanzab
Copy link
Member Author

I'm closing this for now - it's bitrotted

@brendanzab brendanzab closed this Apr 29, 2013
@brendanzab brendanzab deleted the float-encode branch April 29, 2013 02:34
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 9, 2020
Rustup

changelog: none

r? `@ghost`
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.

1 participant