Solved

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

Posted on 2011-02-13
4
433 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 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