You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: exercise-book/src/calculator.md
+6
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,12 @@ You can rewrite bits of it as you see fit.
129
129
For example, the assertion in the `parse` function can go in a way of your tests.
130
130
Feel free to comment it out, or better yet refactor the bit at the end to get rid of it and the `unwrap` call.
131
131
132
+
### Stretch goals
133
+
134
+
* Handle overflow and underflow errors in `eval` function ([`checked_add`](https://doc.rust-lang.org/std/primitive.i64.html#method.checked_add) and similar methods can be very useful here).
135
+
* Add support for unary minus `-` operator.
136
+
**Hard:* change `parse` function to support infix notation, operator precedence, and parentheses.
0 commit comments