Tag Archives: GetHashCode

Use == and != to compare structs in C#

This example shows how you can overload the == and != operators to make it easier to compare structs. By default, for reference types (classes), == returns true if two references refer to the same object (reference equality). It returns … Continue reading

Posted in operators, syntax | Tagged , , , , , , , , , , , , , , , | Leave a comment

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

Use a dictionary to draw a 3D Menger sponge fractal more efficiently using WPF, XAML, and C#

The example Draw a 3D Menger sponge fractal using WPF, XAML, and C# shows how to build a Menger sponge. That example recursively chops up cubes and discards pieces of them until it reaches a desired level of recursion. At … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment