bint

Crates.iobint
lib.rsbint
version0.1.5
sourcesrc
created_at2019-01-20 05:06:28.497467
updated_at2024-04-07 00:51:13.217949
descriptionBounded Integer in Rust.
homepagehttps://github.com/electronicpanopticon/bint-rs
repositoryhttps://github.com/electronicpanopticon/bint-rs.git
max_upload_size
id109616
size10,198
Christoph (folkengine)

documentation

README

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

Commit count: 35

cargo fmt