#arbitrary-precision #numeric #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

#19 in #arbitrary-precision

Download history 357/week @ 2024-05-13 295/week @ 2024-05-20 342/week @ 2024-05-27 332/week @ 2024-06-03 293/week @ 2024-06-10 425/week @ 2024-06-17 328/week @ 2024-06-24 337/week @ 2024-07-01 435/week @ 2024-07-08 363/week @ 2024-07-15 382/week @ 2024-07-22 359/week @ 2024-07-29 409/week @ 2024-08-05 475/week @ 2024-08-12 1068/week @ 2024-08-19 1279/week @ 2024-08-26

3,284 downloads per month
Used in 23 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