Answers for "rust create bigint from string"

1

rust create bigint from string

let vec_number_string = vec![
        "37107287533902102798797998220837590246510135740250",
        "46376937677490009712648124896970078050417018260538",
        "74324986199524741059474233309513058123726617309629"
	];

let mut vec_numbers: Vec<BigInt> = vec![];

for i in 0..vec_number_string.len() {
  let bigint = BigInt::parse_bytes(vec_number_string[i].as_ref(), 10);
  vec_numbers.push(bigint.unwrap());
}
Posted by: Guest on April-02-2022

Browse Popular Code Answers by Language