From bab58d8b7c00b7d39dc521ce37c2443d3db19695 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Fri, 12 Apr 2024 10:39:00 +0200 Subject: [PATCH] whoops --- lab2/zad2/app/src/main/java/pl/jacekpoz/GF.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lab2/zad2/app/src/main/java/pl/jacekpoz/GF.java b/lab2/zad2/app/src/main/java/pl/jacekpoz/GF.java index a21c18b..9a78742 100644 --- a/lab2/zad2/app/src/main/java/pl/jacekpoz/GF.java +++ b/lab2/zad2/app/src/main/java/pl/jacekpoz/GF.java @@ -18,7 +18,7 @@ public class GF { public GF add(final GF rhs) throws IllegalArgumentException { verifyCharacteristics(this, rhs); - return new GF((this.value + rhs.value) % this.characteristic, this.characteristic); + return new GF(this.characteristic, (this.value + rhs.value) % this.characteristic); } public void addAssign(final GF rhs) throws IllegalArgumentException { @@ -30,7 +30,7 @@ public class GF { public GF subtract(final GF rhs) throws IllegalArgumentException { verifyCharacteristics(this, rhs); if (this.value < rhs.value) { - return new GF(this.characteristic - (rhs.value - this.value), this.characteristic); + return new GF(this.characteristic, this.characteristic - (rhs.value - this.value)); } return new GF((this.value - rhs.value), this.characteristic); } @@ -44,7 +44,7 @@ public class GF { public GF multiply(final GF rhs) throws IllegalArgumentException { verifyCharacteristics(this, rhs); - return new GF((this.value * rhs.value) % this.characteristic, this.characteristic); + return new GF(this.characteristic, (this.value * rhs.value) % this.characteristic); } public void multiplyAssign(final GF rhs) throws IllegalArgumentException { @@ -67,7 +67,7 @@ public class GF { } } - return new GF((this.value * inverse) % this.characteristic, this.characteristic); + return new GF(this.characteristic, (this.value * inverse) % this.characteristic); } public void divideAssign(final GF rhs) throws IllegalArgumentException {