Wrox Programmer Forums Difference between decimal and double
 | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
 This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 Read more about Beginning ASP.NET 4: in C# and VB or buy the book from your favorite retailerDownload the code for Beginning ASP.NET 4: in C# and VB
 Welcome to the p2p.wrox.com Forums. You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersâ€™ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
December 3rd, 2011, 09:29 AM
Friend of Wrox
 Points: 547, Level: 8
 Activity: 0%

Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Difference between decimal and double

Hi there,
What is difference between decimal and double data types?
__________________
December 4th, 2011, 04:54 AM
Registered User
 Points: 21, Level: 1
 Activity: 0%

Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post

I take it that you looked up the Data Types in the VBA help and that you would like to know the practical difference. In my experience, numbers of Double type sometimes don't evaluate to zero when one would expect, like
Code:
`IF(SUM(3, 4, 13, -20) = 0, 0, 1)`
This example doesn't show an error, I presume, but Double is capable of returning a non-zero result at the end of a zero-sum calculation. I haven't had a similar experience with Decimal and prefer to use it on principle ever since, which is a long time so that some of the details of the reasons have been forgotten.
December 4th, 2011, 06:05 AM
Wrox Author
 Points: 72,073, Level: 100
 Activity: 100%

Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi there,

Take a look at the table on page 143, chapter 5, where both data types are discussed. Also, Google knows a lot more about this:

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
September 30th, 2014, 04:29 AM
Registered User
 Points: 6, Level: 1
 Activity: 0%

Join Date: Sep 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Difference between decimal and double

The Decimal, Double, and Float variable types are different in the way that they store the values. Precision is the main difference where float is a single precision (32 bit) floating point data type, double is a double precision (64 bit) floating point data type and decimal is a 128-bit floating point data type.

Float - 32 bit (7 digits)

Double - 64 bit (15-16 digits)

Decimal - 128 bit (28-29 significant digits)

More about...Difference between decimal and double

Kerry

Quote:
 Originally Posted by morteza Hi there, What is difference between decimal and double data types?

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post decimal data type all 0's after decimal gobotsoup SQL Server ASP 1 February 28th, 2007 02:32 PM Decimal to String ?!? TPP XSLT 1 January 18th, 2007 12:08 PM decimal harpua Beginning PHP 1 November 3rd, 2005 10:17 PM Decimal Point interrupt Javascript How-To 4 March 16th, 2005 05:53 AM Getting decimal value snowydust VB How-To 1 October 18th, 2004 10:25 AM

All times are GMT -4. The time now is 05:17 PM.