Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

758 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

20 Experts available now in Live!

Get 1:1 Help Now