Created
May 22, 2018 08:53
-
-
Save rust-play/6e859f32d1ba894d346042524e381296 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate num; | |
use num::bigint::BigInt; | |
fn main() { | |
match "123123123123123123123".parse::<BigInt>() { | |
Ok(n) => println!("{}", n), | |
Err(_) => println!("Error") | |
} | |
let bytes = "ff".as_bytes(); | |
let i = BigInt::parse_bytes(bytes, 16).unwrap(); | |
println!("{}", i); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment