From b32d121a27566e692451b10c72608e6310c8a2e6 Mon Sep 17 00:00:00 2001 From: fdai7446 <––fdai7446@fhfddvz1.rz.hs-fulda.de> Date: Fri, 10 Feb 2023 10:48:42 +0100 Subject: [PATCH] potenzieren 2 --- Taschenrechner.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Taschenrechner.java b/Taschenrechner.java index 32ac949..433886b 100644 --- a/Taschenrechner.java +++ b/Taschenrechner.java @@ -20,6 +20,10 @@ public class Taschenrechner { int temp = 1; + if(b == 0) { + return 1; + } + for(int i = 0; i < b; i++) { temp = temp * a; }