maciejhirsz / json-rust

JSON implementation in Rust
Apache License 2.0
563 stars 63 forks source link

get_cached_power() overflows #197

Open totikom opened 3 years ago

totikom commented 3 years ago
get_cached_power(754645927552678136);
get_cached_power(5932085134177075026);
// and similar overflows

Error message: thread 'main' panicked at 'index out of bounds: the len is 87 but the index is 5932085134177075026', /<path ommited>/json-rust/src/util/diyfp.rs:226:16

totikom commented 3 years ago

UPD: get_cached_power_by_index() also overflows with similar error.

totikom commented 3 years ago

UPD2: exponentiate_f32() and exponentiate_f64() crash with thread 'main' panicked at 'attempt to negate with overflow', /<path ommited>/json-rust/src/number.rs:283:21