calc issues
https://gitlab.redox-os.org/redox-os/calc/-/issues
2018-06-10T06:47:01Z
https://gitlab.redox-os.org/redox-os/calc/-/issues/22
Overflow panics on multiplication and exponentiation
2018-06-10T06:47:01Z
Michael Aaron Murphy
mmstick@pm.me
Overflow panics on multiplication and exponentiation
*Created by: xTibor*
**Reproduction**:
```rust
use calc::eval;
// ...
println!("{:?}", eval("2 ** 63"));
println!("{:?}", eval("3040000000 * 3040000000"));
```
**Expected behavior**:
Getting a `CalcError::WouldOverflow` result...
*Created by: xTibor*
**Reproduction**:
```rust
use calc::eval;
// ...
println!("{:?}", eval("2 ** 63"));
println!("{:?}", eval("3040000000 * 3040000000"));
```
**Expected behavior**:
Getting a `CalcError::WouldOverflow` result.
**Actual behavior**:
A panic with an `'attempt to multiply with overflow'` message.
**Build information**:
* `calc`: Latest version from crates.io (`0.5.*`)
* `rustc -V`: `rustc 1.23.0-nightly (e340996ff 2017-11-02)`
* System: KDE neon 5.11 (Ubuntu 16.04 LTS)
**Misc**:
I encountered this issue via Ion's [arithmetic expansions](https://doc.redox-os.org/ion-manual/ch05-04-arithmetic.html).