Browse Source

Merge pull request #349 from 01-edu/doopsubjectfix

add cases of overflow
pull/350/head
LEEDASILVA 5 years ago committed by GitHub
parent
commit
e6d8b1b033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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
- Another value
You should use `Int64`.
The following operators are considered valid: "+", "-", "/", "*", "%".
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$
student@ubuntu:~/piscine-go/test$ ./doop 9223372036854775807 + 1
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
1
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" -1

Loading…
Cancel
Save