Solved

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

Posted on 2011-02-13
4
426 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

680 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