Expand description
This module contains all sorts of utilities which can be helpful for competitive programming.
For example, with the radix function you can convert positive numbers into Strings with a given radix.
use cp_rs::utils::radix;
let num = 5;
let string_base2 = radix(num, 2).to_string();
assert_eq!(string_base2, "101")
Modules§
Structs§
- Radix
- A struct to format a number in an arbitrary radix.
Functions§
- radix
- A helper for creating a new formatter from
Radix::new
.