Skip to content

Commit ad7a538

Browse files
committed
Calculator exercise: add stretch goals
I decided not to change the solution. The stretch goals would probably be done as homework.
1 parent 24b7e8b commit ad7a538

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exercise-book/src/calculator.md

+6
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ You can rewrite bits of it as you see fit.
129129
For example, the assertion in the `parse` function can go in a way of your tests.
130130
Feel free to comment it out, or better yet refactor the bit at the end to get rid of it and the `unwrap` call.
131131

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.
137+
132138
## Help
133139

134140
### Recursive data structures in Rust

0 commit comments

Comments
 (0)