Solved

How is Decimal data type stored in 32-bit memory?

Posted on 2011-02-13
4
421 Views
Last Modified: 2012-05-11
How is the Decimal data type stored in 32-bit memory?

(e.g. i = 100M )
0
Comment
Question by:deleyd
4 Comments
 
LVL 16

Accepted Solution

by:
BurnieP earned 167 total points
ID: 34884711
Hi,

Why are you saying 32 bit?

If you check http://msdn.microsoft.com/en-us/library/364x0z75(v=VS.100).aspx you will see that it is a 128 bit data type.  Even checking other versions of VS by using the link you can see that it was 128 bit in every release of Visual Studio.

0
 
LVL 6

Assisted Solution

by:ViceroyFizzlebottom
ViceroyFizzlebottom earned 167 total points
ID: 34885271
If I'm not mistaken, decimals converted and stored using the IEEE 754 standard. I'm not sure if this will help, but the technical specs can be found here:

http://grouper.ieee.org/groups/754/
0
 
LVL 12

Assisted Solution

by:mwochnick
mwochnick earned 166 total points
ID: 34885366
Below are links with some explanation of the differences in between float, double and Decimal.
The main thing is that float (32bit) and double (64 bit) can be handled by the hardware Decimal - 128bit has to be handled by software in the case of C# by the CLR.  How Decimal works in C# is explained in the first article.  As to how exactly this is done by the CLR on the 32 bit hardware, i was unable to find anything.  

http://gregs-blog.com/2007/12/10/dot-net-decimal-type-vs-float-type/
http://stackoverflow.com/questions/618535/what-is-the-difference-between-decimal-float-and-double-in-c
0
 

Author Closing Comment

by:deleyd
ID: 34889868
Excellent. Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now