#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 637/week @ 2024-01-01 683/week @ 2024-01-08 311/week @ 2024-01-15 633/week @ 2024-01-22 668/week @ 2024-01-29 610/week @ 2024-02-05 503/week @ 2024-02-12 491/week @ 2024-02-19 508/week @ 2024-02-26 628/week @ 2024-03-04 545/week @ 2024-03-11 519/week @ 2024-03-18 568/week @ 2024-03-25 859/week @ 2024-04-01 1065/week @ 2024-04-08 806/week @ 2024-04-15

3,318 downloads per month
Used in 15 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