mozilla/rust — pull request #6094 by bjz (2013-04-28 03:50:16+00:00)
Title: Add float encoding/decoding methods to Float

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

I have included the following methods to the `Float` trait:

~~~rust
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:

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