From 2eacfd02066912b7c6f09ed63d09e94dd7de37d7 Mon Sep 17 00:00:00 2001 From: MSilva95 Date: Tue, 26 Nov 2019 15:44:49 +0000 Subject: [PATCH] changing overflow cases --- subjects/doop.en.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/subjects/doop.en.md b/subjects/doop.en.md index 89834bb17..ec41c1a2e 100644 --- a/subjects/doop.en.md +++ b/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