5 releases

0.1.5 Apr 7, 2024
0.1.4 Oct 13, 2023
0.1.3 Jul 4, 2023
0.1.2 Jul 2, 2023
0.1.0 Jan 20, 2019

#823 in Algorithms

Download history 35/week @ 2024-02-14 81/week @ 2024-02-21 7/week @ 2024-02-28 2/week @ 2024-03-06 6/week @ 2024-03-13 20/week @ 2024-03-20 41/week @ 2024-03-27 219/week @ 2024-04-03 42/week @ 2024-04-10 20/week @ 2024-04-17

64 downloads per month

MIT license

8KB
189 lines

Build Status License: MIT Crates.io Version

bint-rs

Bounded Integer in Rust

Usage

Original immutable Bint:

extern crate bint;

let b: bint::Bint = bint::Bint {value: 5, boundary: 6 };
let c: Bint = b.up();
let d: Bint = c.up();

println!("{} {} {}", b, c, d); // Prints 5 0 1

New and improved BintCell:

use bint::BintCell;

let b = BintCell::new(6);
b.down();
assert_eq!(5, b.value());

b.up();
b.up();
b.up();
assert_eq!(2, b.value());

Other examples

No runtime deps