Hi, first of all, thanks for the great crate.
However, dealing with large numbers can easily cause integer overflows. For example, the following code would cause a runtime panic for debug build and return a wrong answer for release build:
use byte_unit;
fn main() {
println!("{}", byte_unit::n_zb_bytes(std::u128::MAX)); // integer overflow
}
Prabably it is better to add more documentations to illustrate under what conditions these functions would not work properly.
Hi, first of all, thanks for the great crate.
However, dealing with large numbers can easily cause integer overflows. For example, the following code would cause a runtime panic for debug build and return a wrong answer for release build:
Prabably it is better to add more documentations to illustrate under what conditions these functions would not work properly.