From 3bdc916af31ec28b062fadec5f59567798725cf0 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Tue, 26 Nov 2019 10:55:29 +0000 Subject: [PATCH] Doop Operators and Overflow --- subjects/doop.en.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subjects/doop.en.md b/subjects/doop.en.md index fd67dc19..3f362370 100644 --- a/subjects/doop.en.md +++ b/subjects/doop.en.md @@ -10,10 +10,14 @@ The program has to be used with three arguments: - An operator - Another value +The following operators are considered valid: "+", "-", "/", "*", "%". + In case of an invalid operator the programs prints `0`. In case of an invalid number of arguments the program prints nothing. +In case of overflow the program prints **Overflow**. + The program has to handle the modulo and division operations by 0 as shown on the output examples below. `fmt.Print` is authorized. @@ -33,6 +37,8 @@ student@ubuntu:~/piscine-go/test$ ./doop 1 / 0 | cat -e 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 student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1 1 student@ubuntu:~/piscine-go/test$ ./doop 1 "*" -1