Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Pallant <jonathan.pallant@ferrous-systems.com>
  • Loading branch information
listochkin and jonathanpallant authored Feb 4, 2025
1 parent 0d255e6 commit 3b00a27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercise-book/src/calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ You will learn:
## Task

Write a library that parses and evaluates math expressions that use [Reverse-Polish (postfix) notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation).
For example, a string `"3 1 + 2 /"` in this notation is equivalent to `(3 + 1) / 2` but unlike the later it does not force us to handle operator precedence using parenthesis.
For example, a string `"3 1 + 2 /"` in this notation is equivalent to `(3 + 1) / 2` but unlike the later it does not force us to handle operator precedence using parentheses.

We will support the 4 basic math operations (`+`, `-`, `*`, `/`) that all will expect two operants, and a `sqr` operation to square a single number.
We will support the 4 basic math operations (`+`, `-`, `*`, `/`) that all will expect two operands, and a `sqr` operation to square a single number.

Here's a basic grammar of expressions that we can expect:

Expand Down Expand Up @@ -491,7 +491,7 @@ fn square() {

Some observations:

* Every branch of our big `match` statement eds up producing an expression.
* Every branch of our big `match` statement ends up producing an expression.
* Every time we `pop` expressions from the stack we have to box them.

So, here's a plan:
Expand Down

0 comments on commit 3b00a27

Please sign in to comment.