bignumber 0.0.13

A Rust library for arbitrary-precision decimal and non-decimal arithmetic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::str::FromStr;

use crate::{BigNumber, BigNumberError};

impl From<usize> for BigNumber {
    #[inline]
    fn from(n: usize) -> Self {
        BigNumber::of(n.to_string().as_str()).unwrap()
    }
}

impl FromStr for BigNumber {
    type Err = BigNumberError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        BigNumber::of(s)
    }
}