1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Arbitrary precision floating point number implementation, as a part of the `dashu` library for arbitrary-precision mathematics. See [Docs.rs](https://docs.rs/dashu-float/latest/dashu_float/) for the full documentation.
- ------
Binary and decimal float literals, correctly-rounded transcendentals, and the
`Context` layer for explicit precision control:
```rust
use dashu::{fbig, dbig};
use dashu_float::{Context, round::mode::HalfEven};
// Binary and decimal float literals — hex floats, precision from digit count
let x = fbig!(0x1.fffp-1); // ≈ 0.9998
let pi = dbig!(3.1415926535897932384626);
// Correctly-rounded transcendentals (Ziv engine)
let e = x.exp(); // exp(0.9998…), binary
let _log_pi = pi.ln();
// Context layer: IEEE 754 binary64 precision, HalfEven rounding
let ctx = Context::<HalfEven>::new(53);
let e53 = ctx.exp(&x.repr(), None).unwrap().value();
assert!(e53 > e); // higher precision, larger value
// set the precision explicitly
let x50 = x.with_precision(50).value();
assert_eq!(x50.precision(), 50);
```
*
Relevant benchmark will be implemented in the [built-in benchmark](../benchmark/).
See the [top-level readme](../README.md).