- Checkout Project (In case if you need project stub)
- Implement in YourNameComplex.scala file
- Send it by e-mail: [email protected]
- Deadline is 27 September 2012, 21:00
Implement case class Complex(re: Double, im: Double).
- It should contain following operators: +, -, *, /, unary_+, unary_-, ^. Override toString method.
- Complex companion should contain I constant. And possibility to write code like Re(z), Im(z). Also add methods conjugation, sqrt, abs.
- Add auxiliary constructor from String.
- It should be possible to use all operators with other numeric types on the left and on the right side.
- Note that for every task part you can write code with any implementation and complexity (like two sqrt values or one). All of this is up to you.