Skip to main content

from_base

Function from_base 

Source
pub fn from_base(s: &str, base: u32) -> Option<u64>
Expand description

Parse a string in the given base (2-36) to u64.

ยงExamples

use mathverse_core::integer::from_base;

assert_eq!(from_base("ff", 16), Some(255));
assert_eq!(from_base("1010", 2), Some(10));