Crate break_eternity[][src]

Expand description

A numerical library to represent numbers as large as 10^^1e308 and as ‘small’ as 10^-(10^^1e308).

Examples

use break_eternity::Decimal;

let a = Decimal::from_number(1.0);
let b = Decimal::from_number(2.0);

let c = a + b;
assert_eq!(c, Decimal::from_number(3.0));

Structs

A Decimal number that can represent numbers as large as 10^^1e308 and as ‘small’ as 10^-(10^^1e308).

Enums

Error type for all errors in this crate.

Constants

exp(-1)

Exponent limit to increase a layer (9e15 is about the largest safe number)

At layer 0, smaller non-zero numbers than this become layer 1 numbers with negative mag.

Layer reduction threshold

Amount of Es that will be printed in a string representation of a Decimal.

Maximum number of digits of precision to assume in a float

Maximum number powers of 10 that will be cached.

Largest exponent that can appear in a number.

Smallest exponent that can appear in a number.

W(1, 0)

2*PI

Functions

Truncates the given number to the given number of significant digits and rounds, if necessary.

Returns the sign of the number.

Formats the given number to the given number of significant digits.