Module core::num::dec2flt::algorithm [] [src]

Unstable (dec2flt)

: internal routines only exposed for testing

The various algorithms from the paper.

Reexports

use prelude::v1::*;
use cmp::min;
use cmp::Ordering::{Less, Equal, Greater};
use num::diy_float::Fp;
use num::dec2flt::table;
use num::dec2flt::rawfp::{self, Unpacked, RawFloat, fp_to_float, next_float, prev_float};
use num::dec2flt::num::{self, Big};

Constants

P [Unstable]

Number of significand bits in Fp

Functions

algorithm_m [Unstable]

Conceptually, Algorithm M is the simplest way to convert a decimal to a float.

algorithm_r [Unstable]

An iterative algorithm that improves a floating point approximation of f * 10^e.

bellerophon [Unstable]

Algorithm Bellerophon is trivial code justified by non-trivial numeric analysis.

fast_path [Unstable]

The fast path of Bellerophon using machine-sized integers and floats.

make_ratio [Unstable]

Given x = f and y = m where f represent input decimal digits as usual and m is the significand of a floating point approximation, make the ratio x / y equal to (f * 10^e) / (m * 2^k), possibly reduced by a power of two both have in common.

power_of_ten [Unstable]
quick_start [Unstable]

Skip over most AlgorithmM iterations by checking the bit length.

round_by_remainder [Unstable]

Ordinary round-to-even, obfuscated by having to round based on the remainder of a division.

underflow [Unstable]