Wrox Programmer Forums
|
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
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2011, 09:29 AM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Default Difference between decimal and double

Hi there,
What is difference between decimal and double data types?
__________________
Please excuse me for poor and bad English.
 
Old December 4th, 2011, 04:54 AM
Registered User
 
Join Date: Dec 2011
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
 
Old December 4th, 2011, 06:05 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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:

http://www.google.nl/#sclient=psy-ab...double+decimal

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

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.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 30th, 2014, 04:29 AM
Registered User
 
Join Date: Sep 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 View Post
Hi there,
What is difference between decimal and double data types?





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.