datatype "Decimal" in VB.Net is 32-bit or 64-bit?

  • Thread starter Thread starter Wong Kean Boon
  • Start date Start date
W

Wong Kean Boon

Guest
Module Module1

Sub Main()
Dim pi As Decimal = 3D

System.Console.WriteLine("Calculation in Progress...")
For i As Integer = 1 To 10000000
If i Mod 2 = 1 Then
pi = pi + (4 / ((2D * i) * ((2D * i) + 1) * ((2D * i) + 2)))
Else
pi = pi - (4 / ((2D * i) * ((2D * i) + 1) * ((2D * i) + 2)))
End If
Next
Console.WriteLine("Result is {0}", pi.ToString)
Console.WriteLine("Press any Key to Continue...")
System.Console.ReadKey()
End Sub

End Module

code above is program to calculate number of Pi.

I know datatype of "Decimal" will is occupy 16 byte memory allocation. but I wish to know data will be store as 64-bit data in 64-bit program or 32-bit data in 64-bit program? or 16-bit instead?

Continue reading...
 

Similar threads

Back
Top