#arbitrary-precision #big-integer

macro no-std dashu-macros

Procedure macros for creating big numbers

5 unstable releases

0.4.1 Jan 12, 2024
0.4.0 Sep 12, 2023
0.3.1 Nov 10, 2022
0.3.0 Nov 10, 2022
0.2.0 Sep 13, 2022

#20 in #arbitrary-precision

Download history 363/week @ 2024-07-23 422/week @ 2024-07-30 382/week @ 2024-08-06 493/week @ 2024-08-13 1217/week @ 2024-08-20 1174/week @ 2024-08-27 1217/week @ 2024-09-03 1593/week @ 2024-09-10 1657/week @ 2024-09-17 3121/week @ 2024-09-24 5777/week @ 2024-10-01 6303/week @ 2024-10-08 4019/week @ 2024-10-15 3683/week @ 2024-10-22 2474/week @ 2024-10-29 3346/week @ 2024-11-05

14,866 downloads per month
Used in 38 crates (via dashu)

MIT/Apache

1MB
24K SLoC

dashu-macros

Utility macros to create number literals. See Docs.rs for the full documentation.

Features

  • Support creating big integers with literals using ubig! and ibig!.
  • Support creating big floats with literals using fbig! and dbig!.
  • Support creating big rationals with literals using rbig!.
  • All macros can be used to create const numbers if they are small enough.

License

See the top-level readme.


lib.rs:

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.

Dependencies