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
54
55
56
57
58
59
60
61
//! A `#![no_std]` fixed-point decimal library with four types for different precision/size needs.
//!
//! | Type | Integer/Frac | Scale | Size |
//! |---|---|---|---|
//! | [`AncDec8`] | `u8` | 0-2 | 4 bytes |
//! | [`AncDec32`] | `u32` | 0-9 | 12 bytes |
//! | [`AncDec`] | `u64` | 0-19 | 24 bytes |
//! | [`AncDec128`] | `u128` | 0-38 | 40 bytes |
//!
//! All types store integer and fractional parts separately with an explicit scale,
//! avoiding the precision loss inherent in floating-point representations.
//!
//! # Feature flags
//!
//! - **`dec8`** / **`dec32`** / **`dec64`** / **`dec128`** -- enable individual types (all on by default)
//! - **`serde`** -- string-based `Serialize`/`Deserialize`
//! - **`sqlx`** -- PostgreSQL `NUMERIC` support (implies `std` + `dec64`)
extern crate std;
// Shared modules (always compiled)
pub use ParseError;
pub use RoundMode;
// Wide arithmetic: needed by dec32 (isqrt_u128), dec64 and dec128
pub
// ============ AncDec8 (u8) ============
pub use AncDec8;
// ============ AncDec32 (u32) ============
pub use AncDec32;
// ============ AncDec (u64) ============
pub use AncDec;
// ============ AncDec128 (u128) ============
pub use AncDec128;
// ============ Cross-type operations ============