0
kicks
C#/.NET Pitfalls: Nullable Math Doesn’t Always Add Up
C# is a wonderful language for modern programming.  Occasionally, however, there are things that are syntactically legal, but can bite you if you aren’t aware of what is actually going on behind the scenes. This is my third post in the Little Pitfalls series where I explore these small pitfalls and discuss what’s going on and how to avoid it.
In the last Little Wonders post, we talked about the Nullable static class (not to be confused with the Nullable<T> struct) and through that venue discussed some of the issues comparing nullable numeric values which evaluate to null.
This week we will dive deeper into that discussion and discuss more fully the little pitfall deals of performing math or comparisons on System.Nullable<T> wrapped value type that support the arithmetic and/or comparison operator overloads.