Ex W7 |home |print view |recent changes |changed November 4, 2016 | exact |You are 54.81.88.93 <- set your identity!

### Catch up!^

• extend your date class with enums from ExW6

### 1 Finite Field Modulo 5^

Take the Ring5 class from the github and modify it to a class Field5. We will use it to implement a finite field (galois field/endlicher Körper).

• provide subtraction as inverse of addition.
• can it be mapped directly to integer subtraction?
• a - a = 0
• 3-4 = 4 <=> 4+4 = 3
• provide unary minus operator for negation
• a + (-a) = 0
• provide division as inverse of multiplication.
• first figure out for each x (excluding 0), what y provides 1/x = y -> 1 = x*y
• Does it make sense to provide relational operators for Field5?

## optional Exercise^

### 2 Ring Modulo 6^

Implement a class Ring6 that implements modulo arithmetic for unsigned integers modulo 6.

• Start out with corresponding test cases, before you implement an operation.
• Provide addition and multiplication operators.
• Provide output operator to a stream.
• Provide inward and outward conversion from unsigned integers.
• When is it useful to make these conversions explicit?
• Is it useful to implement subtraction for Ring6?
• Is it useful/possible to implement division for Ring6?