Browse Source

changing overflow cases

content-update
MSilva95 5 years ago committed by Xavier Petit
parent
commit
2eacfd0206
  1. 10
      subjects/doop.en.md

10
subjects/doop.en.md

@ -14,13 +14,11 @@ You should use `int64`.
The following operators are considered valid: `+`, `-`, `/`, `*`, `%`.
In case of an invalid operator the programs prints `0`.
In case of an invalid operator or overflow the programs prints `0`.
In case of an invalid number of arguments the program prints nothing.
In case the result gives overflow the program prints `Overflow`.
The program has to handle the module and division operations by 0 as shown on the output examples below.
The program has to handle the modulo and division operations by 0 as shown on the output examples below.
### Usage
@ -38,11 +36,11 @@ No division by 0$
student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 | cat -e
No Modulo by 0$
student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 + 1
Overflow
0
student@ubuntu:~/piscine-go/test$ ./doop -9223372036854775809 "*" 3
0
student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 "*" 3
Overflow
0
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1
1
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" -1

Loading…
Cancel
Save