Decimal Types

Crypto Ultimatum

How Exactly Do You Get Rich From Cryptocurrency

Get Instant Access

Just as there are several types to store integer values, there are three implementations of value types to store real number values, shown in Table 2-3. The Single and Double types work the same way in Visual Basic .NET as they did in Visual Basic 6.0. The difference is the Visual Basic 6.0 Currency type (which was a specialized version of a Double type), is now obsolete; it was replaced by the Decimal value type for very large real numbers.

TABLE 2-3: Memory Allocation for Real Number Types

type

allocated memory

negative range

4 bytes

1 401298E-45 to 3 402823E38

Single

Double

Currency Decimal

4 bytes

8 bytes

Obsolete 16 bytes

-3.402823E38to -1.401298E-45

-1.79769313486231E308 to -4.940656 45841247E-324

-79228162514264 337593543950335 to 0.00000000000000 00000000000001

1 401298E-45 to 3 402823E38

4.940656 45 841247E-324 to 1.79769313486232E308

0.00000000000000 00000000000001 to 792281625142643 37593543950335

Was this article helpful?

+1 0

Post a comment