15 releases

0.1.15 May 1, 2024
0.1.13 Mar 5, 2022
0.1.11 Apr 21, 2021
0.1.10 Jul 29, 2020
0.1.0 Nov 30, 2018

#236 in Math

Download history 32/week @ 2024-09-23 2/week @ 2024-09-30

951 downloads per month

MIT license

8KB
120 lines

bc (An arbitrary precision calculator language)

CI

Use bc in the Rust Programming Language.

Examples

let result = bc::bc!("2 + 6");

assert_eq!("8", result.unwrap());
let result = bc::bc!("2.5 + 6");

assert_eq!("8.5", result.unwrap());
let result = bc::bc_timeout!("99^99");

assert_eq!("369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899", result.unwrap());
let result = bc::bc_timeout!(20, "99^99");

assert_eq!("369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899", result.unwrap());

Crates.io

https://crates.io/crates/bc

Documentation

https://docs.rs/bc

License

MIT

Dependencies

~0.5–1MB
~23K SLoC