Skip to content

Commit caeb928

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature
2 parents e0b0822 + 3e2ed9b commit caeb928

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

final_task/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ error explanation **with "ERROR: " prefix** and exit with non-zero exit code:
2727
```shell
2828
$ pycalc '15(25+1'
2929
ERROR: brackets are not balanced
30-
$ pycalc 'sin(-Pi/4)**1.5'
31-
ERROR: negative number cannot be raised to a fractional power
30+
$ pycalc 'func'
31+
ERROR: unknown function 'func'
3232
```
3333

3434
### Mathematical operations calculator must support
3535
* Arithmetic (`+`, `-`, `*`, `/`, `//`, `%`, `^`) (`^` is a power).
3636
* Comparison (`<`, `<=`, `==`, `!=`, `>=`, `>`).
37-
* 3 built-in python functions: `abs`, `pow`, `round`.
37+
* 2 built-in python functions: `abs` and `round`.
3838
* All functions and constants from standard python module `math` (trigonometry, logarithms, etc.).
3939

4040

@@ -89,9 +89,9 @@ These requirements are not mandatory for implementation, but you can get more po
8989
```shell
9090
$ pycalc 'sin(pi/2)'
9191
1.0
92-
$ pycalc -m my_module 'sin(pi/2)'
92+
$ pycalc 'sin(pi/2)' -m my_module
9393
42
94-
$ pycalc -m time 'time()/3600/24/365'
94+
$ pycalc 'time()/3600/24/365' -m time
9595
48.80147332327218
9696
```
9797

pycalc_checker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
"log10(100)": log10(100),
3434
"sin(pi/2)*111*6": sin(pi/2)*111*6,
3535
"2*sin(pi/2)": 2*sin(pi/2),
36+
"pow(2, 3)": pow(2, 3),
37+
"abs(-5)": abs(-5),
38+
"round(123.4567890)": round(123.4567890),
3639
}
3740

3841
ASSOCIATIVE = {

0 commit comments

Comments
 (0)