Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| 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
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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 3rd, 2011, 09:29 AM
Friend of Wrox
Points: 547, Level: 8
Points: 547, Level: 8 Points: 547, Level: 8 Points: 547, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old December 4th, 2011, 04:54 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #3 (permalink)  
Old December 4th, 2011, 06:05 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #4 (permalink)  
Old September 30th, 2014, 04:29 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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.


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