Browse Source

add cases of overflow

pull/349/head
MSilva95 5 years ago
parent
commit
7189b3656d
  1. 6
      subjects/doop.en.md

6
subjects/doop.en.md

@ -10,6 +10,8 @@ The program has to be used with three arguments:
- An operator - An operator
- Another value - Another value
You should use `Int64`.
The following operators are considered valid: "+", "-", "/", "*", "%". The following operators are considered valid: "+", "-", "/", "*", "%".
In case of an invalid operator the programs prints `0`. In case of an invalid operator the programs prints `0`.
@ -39,6 +41,10 @@ student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 | cat -e
No Modulo by 0$ No Modulo by 0$
student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 + 1 student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 + 1
Overflow Overflow
student@ubuntu:~/piscine-go/test$ ./doop -9223372036854775809 "*" 3
Overflow
student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 "*" 3
Overflow
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1 student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1
1 1
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" -1 student@ubuntu:~/piscine-go/test$ ./doop 1 "*" -1

Loading…
Cancel
Save