variable_base_factoradic

Crates.iovariable_base_factoradic
lib.rsvariable_base_factoradic
version0.0.1
sourcesrc
created_at2023-10-30 23:34:16.221954
updated_at2023-10-30 23:34:16.221954
descriptionRust implementation of Randall Munroe's variable base factoradic number system: https://xkcd.com/2835/
homepagehttps://soerface.github.io/variable_base_factoradic/
repositoryhttps://github.com/soerface/variable_base_factoradic_rs
max_upload_size
id1019195
size15,751
Sören Wegener (soerface)

documentation

README

Variable-base Factoradic numbers

Implementation of https://xkcd.com/2835/

Installation

https://crates.io/crates/variable_base_factoradic

cargo install variable_base_factoradic

Usage

use variable_base_factoradic::VariableBaseFactoradicNumber;

// Convert from decimal to factoradic
let v = VariableBaseFactoradicNumber::try_new(5038).unwrap();
println!("{}", v.to_string()); // 654320

// Convert from factoradic to decimal
let v = "654320".parse::<VariableBaseFactoradicNumber>().unwrap();
println!("{}", v.value); // 5038
Commit count: 2

cargo fmt