3 个不稳定版本

0.2.1 2021年11月26日
0.2.0 2021年11月25日
0.1.0 2021年11月24日

6#num-bigint

Download history · Rust 包仓库 3/week @ 2024-03-13 · Rust 包仓库 18/week @ 2024-03-27 · Rust 包仓库 30/week @ 2024-04-03 · Rust 包仓库 3/week @ 2024-04-24 · Rust 包仓库 1/week @ 2024-05-01 · Rust 包仓库 35/week @ 2024-05-08 · Rust 包仓库 171/week @ 2024-05-15 · Rust 包仓库 76/week @ 2024-05-22 · Rust 包仓库 84/week @ 2024-05-29 · Rust 包仓库 127/week @ 2024-06-05 · Rust 包仓库 198/week @ 2024-06-12 · Rust 包仓库 68/week @ 2024-06-19 · Rust 包仓库 60/week @ 2024-06-26 · Rust 包仓库

463 每月下载量
用于 nalgebra_latex

MIT/Apache

7KB
88

const_num_bigint

const

    use const_num_bigint::*;
    use std::str::FromStr;
    const TEST_INT : &'static BigInt = bigint!("123");
    let bigint = BigInt::from_str("123").unwrap();
    assert!(&bigint==TEST_INT);
    const TEST_INT2 : &'static BigInt = bigint!("-123");
    let bigint2 = BigInt::from_str("-123").unwrap();
    assert!(&bigint2==TEST_INT2);
    const TEST_INT3 : &'static BigInt =
        bigint!("123123123123123123123123123123123123123123123123123123123123123123123123123123");
    let bigint3 = BigInt::from_str(
        "123123123123123123123123123123123123123123123123123123123123123123123123123123"
    ).unwrap();
    assert!(&bigint3==TEST_INT3);
    const TEST_UINT : &'static BigUint = biguint!(
        "123123123123123123123123123123123123123123123123123123123123123123123123123123"
    );
    let biguint = BigUint::from_str(
        "123123123123123123123123123123123123123123123123123123123123123123123123123123"
    ).unwrap();
    assert!(&biguint==TEST_UINT);
    assert!(&biguint==
        biguint!("123123123123123123123123123123123123123123123123123123123123123123123123123123")
    );
    let pi_str = include_str!("pi.num");
    let biguint_pi = BigUint::from_str(pi_str).unwrap();
    assert!(&biguint_pi==
        biguint_file!("src/pi.num")
    );

许可证:MIT OR Apache-2.0

依赖项

~2MB
~46K SLoC