473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Articles on Choosing the Best Numeric Data Type

Does anyone know of any articles that discuss the best practice for choosing a numeric data type. I remember seeing a good article in the past, but can't remember where. I am interested in articles that give advice when you should choose a 'Single', 'Double' or 'Decimal' and why. I am trying to push the idea that decimals should not be used everywhere, but I need articles supporting that position.
Nov 22 '05 #1
4 1530
I don't see why you need an article.... unless you need the sheer size
(decimal) or the accuracy (double) you should just use single everywhere you
need a "real" number. Like everything else, this is a tradeoff between
performance and memory usage and the features that your code requires.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Brian" <an*******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
Does anyone know of any articles that discuss the best practice for

choosing a numeric data type. I remember seeing a good article in the past,
but can't remember where. I am interested in articles that give advice when
you should choose a 'Single', 'Double' or 'Decimal' and why. I am trying to
push the idea that decimals should not be used everywhere, but I need
articles supporting that position.
Nov 22 '05 #2
I don't see why you need an article.... unless you need the sheer size
(decimal) or the accuracy (double) you should just use single everywhere you
need a "real" number. Like everything else, this is a tradeoff between
performance and memory usage and the features that your code requires.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Brian" <an*******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
Does anyone know of any articles that discuss the best practice for

choosing a numeric data type. I remember seeing a good article in the past,
but can't remember where. I am interested in articles that give advice when
you should choose a 'Single', 'Double' or 'Decimal' and why. I am trying to
push the idea that decimals should not be used everywhere, but I need
articles supporting that position.
Nov 22 '05 #3
Brian <an*******@discussions.microsoft.com> wrote:
Does anyone know of any articles that discuss the best practice for
choosing a numeric data type. I remember seeing a good article in the
past, but can't remember where. I am interested in articles that give
advice when you should choose a 'Single', 'Double' or 'Decimal' and
why. I am trying to push the idea that decimals should not be used
everywhere, but I need articles supporting that position.


I give a bit of advice in

http://www.pobox.com/~skeet/csharp/floatingpoint.html
and
http://www.pobox.com/~skeet/csharp/decimal.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #4
Brian <an*******@discussions.microsoft.com> wrote:
Does anyone know of any articles that discuss the best practice for
choosing a numeric data type. I remember seeing a good article in the
past, but can't remember where. I am interested in articles that give
advice when you should choose a 'Single', 'Double' or 'Decimal' and
why. I am trying to push the idea that decimals should not be used
everywhere, but I need articles supporting that position.


I give a bit of advice in

http://www.pobox.com/~skeet/csharp/floatingpoint.html
and
http://www.pobox.com/~skeet/csharp/decimal.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: James | last post by:
Hello group: I've done alot of reading on this subject somewhat and have found that many people have many different opinions on this subject. My question centers mainly around using a lookup...
4
by: Brian | last post by:
Does anyone know of any articles that discuss the best practice for choosing a numeric data type. I remember seeing a good article in the past, but can't remember where. I am interested in articles...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: Brian | last post by:
Does anyone know of any articles that discuss the best practice for choosing a numeric data type. I remember seeing a good article in the past, but can't remember where. I am interested in articles...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.