Chapter 5. Numeric and Boolean Types

Numeric types, as the name suggests, represent numbers. These types, and the operations that can be used on them, are the basis for C# mathematics support. The Boolean type allows you to express true and false values—a feature that you can use directly with the bool type or indirectly when conditions are evaluated in conditional statements.

In this chapter, you'll see the different types that are available to represent different kinds of numbers and how to define numeric values using numeric literals and the range of numeric operators that C# supports. I'll also show you how to use Boolean literals and how Booleans are used when operations are performed and conditions evaluated. Table 5-1 provides the summary ...

Get Introducing Visual C# 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.