Category Archives: operators

Refine the complex number class in C#

This example shows how to refine the complex number class defined by the example Make a complex number class that works with real numbers in C#. That example explains how to build a Complex class that represents complex numbers. It … Continue reading

Posted in classes, mathematics, OOP, operators | Tagged , , , , , , , , , , , , , , , | 1 Comment

Make a complex number class that works with real numbers in C#

The example Make a complex number class with overloaded operators in C# builds a simple Complex class that includes overloaded +, -, *, and / operators that let you combine Complex objects. For example, a program can execute the following … Continue reading

Posted in classes, mathematics, OOP, operators | Tagged , , , , , , , , , , , , , , , | 1 Comment

Make a complex number class with equality in C#

The example Make a complex number class with overloaded operators in C# builds a simple Complex class that includes overloaded +, -, *, and / operators that let you combine Complex objects. For example, a program can execute the following … Continue reading

Posted in classes, mathematics, OOP, operators | Tagged , , , , , , , , , , , , , , , | 3 Comments

Make a complex number class with overloaded operators in C#

This example uses a complex number class to demonstrate operator overloading, a technique that allows you to define operators such as + and * for objects. Many people use a complex number class as an example because the operators are … Continue reading

Posted in classes, mathematics, OOP, operators | Tagged , , , , , , , , , , , | 3 Comments

Overload == and != to make comparing two structs easy in C#

Sorry I only had three posts last week. I try for around five per week but sometimes things get hectic and I got stuck on a really complicated example. That also made me realize that I’ve been posting some pretty … Continue reading

Posted in operators, syntax | Leave a comment