Crate dashu_macros
source ·Expand description
A macro library for creating big numbers from literals.
See the documentation of each macro for the usage.
Dependency requirement
Due the fact that the macros expand to plain tokens, and proc macro crates can’t
re-export types, it’s required to add explicit dependency to the underlying crates
when using the macros. Specifically, you need to add the following crates as dependencies
to your Cargo.toml
:
- For ubig!/static_ubig! and ibig!/static_ibig!:
dashu-int
- For fbig! and dbig!:
dashu-int
,dashu-float
- For rbig!:
dashu-int
,dashu-ratio
If you are using these macros from the dashu
crate, then it’s not necessary to
explicitly adding these dependencies, because the related types are re-exported
by the dashu
crate.
Macros
- Create an arbitrary precision float number (dashu_float::DBig) with base 10 rounding to the nearest.
- Create an arbitrary precision float number (dashu_float::FBig) with base 2 rounding towards zero.
- Create an arbitrary precision signed integer (dashu_int::IBig)
- Create an arbitrary precision rational number (dashu_ratio::RBig or dashu_ratio::Relaxed).
- Create an arbitrary precision float number (dashu_float::DBig), with base 10 rounding to the nearest, as a static reference.
- Create an arbitrary precision float number (dashu_float::FBig), with base 2 rounding towards zero, as a static reference.
- Create an arbitrary precision signed integer (dashu_int::IBig) as a static reference.
- Create an arbitrary precision rational number (dashu_ratio::RBig or dashu_ratio::Relaxed) as a static reference.
- Create an arbitrary precision unsigned integer (dashu_int::UBig) as a static reference.
- Create an arbitrary precision unsigned integer (dashu_int::UBig)