#numbers #base #convert #radix

bin+lib num_base

Crate for manipulating with numbers (integers) in different bases

13 unstable releases (3 breaking)

0.4.2 Sep 23, 2022
0.4.1 Sep 23, 2022
0.3.5 Sep 6, 2022
0.2.0 Aug 30, 2022
0.1.2 Aug 22, 2022

#768 in Math

Download history 7/week @ 2024-02-11 131/week @ 2024-02-18 6/week @ 2024-02-25 14/week @ 2024-03-10 186/week @ 2024-03-31

200 downloads per month

AGPL-3.0-only

28KB
612 lines

num_base

Crate for manipulating with numbers (integers) in different bases.

Quick start

use num_base::Based;

let num = Based::new("101", 10).to(2);

assert_eq!(num.val, "1100101")

Optional features

  • ops - Implementation for Add, Sub, Mul, Div and Rem.
  • cli - Install with: cargo install num_base --features cli.

lib.rs:

Crate for manipulating with numbers (integers) in different bases.

Quick start

use num_base::Based;

let num = Based::new("101", 10).to(2).unwrap();

assert_eq!(num.val, "1100101")

Optional features

  • ops - Implementation for Add, Sub, Mul, Div and Rem.
  • cli - Install with: cargo install num_base --features cli.

Dependencies

~0–455KB