Click here to Skip to main content
15,879,474 members
Home / Discussions / C#
   

C#

 
GeneralRe: codeproject template empty Pin
Rassler4820-Nov-09 20:49
Rassler4820-Nov-09 20:49 
GeneralRe: codeproject template empty Pin
Richard MacCutchan20-Nov-09 21:13
mveRichard MacCutchan20-Nov-09 21:13 
GeneralRe: codeproject template empty Pin
Rassler4821-Nov-09 5:37
Rassler4821-Nov-09 5:37 
Questionrequest: fixing a codeproject programm Pin
no_idea20-Nov-09 6:40
no_idea20-Nov-09 6:40 
AnswerRe: request: fixing a codeproject programm Pin
DaveyM6920-Nov-09 8:18
professionalDaveyM6920-Nov-09 8:18 
GeneralRe: request: fixing a codeproject programm Pin
no_idea20-Nov-09 10:16
no_idea20-Nov-09 10:16 
GeneralRe: request: fixing a codeproject programm Pin
DaveyM6920-Nov-09 16:29
professionalDaveyM6920-Nov-09 16:29 
GeneralRe: request: fixing a codeproject programm Pin
dojohansen23-Nov-09 10:50
dojohansen23-Nov-09 10:50 
Seeing as it's a graph you should cast it to double. Decimal would work too, but is more expensive and offers no benefit in this application.

Try this: Open a new tab. Type "javascript:alert(0.1+0.2)" in the address bar. Now gape at the result, which is close to but not quite 0.3 - and read on to stop gaping.

Decimal is a type that can represent decimal numbers accurately. Computer hardware is of course made for working with binary numbers.

It is not possible, in general, to represent numbers in different bases accurately using the same number of digits, and sometimes not using *any* number of digits (though it is always possible to represent rational numbers as ratios in any base, and never possible to represent any irrational number as a ratio, in any base). For example, one third is an infinite sequence in base ten (0.33333333...) but it is simply 0.1 in base 3.

Decimal is useful in financial applications where it matters that base-ten numbers are exactly represented, but they are comparatively slow since your computer hardware doesn't have instructions to do arithmetics with them. The type must instead provide a software algorithm that manipulates the bits representing a decimal number. By all means, you'll probably never notice any difference, but in general, use double whenever you don't need an exact decimal-number representation. This is a case of drawing a graph, hence of mapping the value in question to a pixel, and it resolutely doesn't matter if it always snaps to the pixel it would have done if you used a decimal, so clearly the correct choice is double. Smile | :)
QuestionAlter table in dataset Pin
daniel kuperberg20-Nov-09 6:36
daniel kuperberg20-Nov-09 6:36 
AnswerRe: Alter table in dataset Pin
dojohansen23-Nov-09 10:53
dojohansen23-Nov-09 10:53 
Questionbetter way to make function returns Pin
netJP12L20-Nov-09 6:13
netJP12L20-Nov-09 6:13 
AnswerMessage Closed Pin
20-Nov-09 6:15
stancrm20-Nov-09 6:15 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 6:28
netJP12L20-Nov-09 6:28 
GeneralRe: better way to make function returns [modified] Pin
Saksida Bojan20-Nov-09 6:34
Saksida Bojan20-Nov-09 6:34 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 6:50
netJP12L20-Nov-09 6:50 
GeneralRe: better way to make function returns Pin
Saksida Bojan20-Nov-09 6:59
Saksida Bojan20-Nov-09 6:59 
AnswerRe: better way to make function returns Pin
0x3c020-Nov-09 6:38
0x3c020-Nov-09 6:38 
AnswerRe: better way to make function returns Pin
musefan20-Nov-09 7:39
musefan20-Nov-09 7:39 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 8:34
netJP12L20-Nov-09 8:34 
AnswerRe: better way to make function returns Pin
dojohansen23-Nov-09 10:59
dojohansen23-Nov-09 10:59 
QuestionStream closes while reading a socket Pin
joana.simoes20-Nov-09 5:11
joana.simoes20-Nov-09 5:11 
AnswerRe: Stream closes while reading a socket Pin
Paulo Zemek20-Nov-09 5:57
mvaPaulo Zemek20-Nov-09 5:57 
GeneralRe: Stream closes while reading a socket Pin
joana.simoes20-Nov-09 6:19
joana.simoes20-Nov-09 6:19 
GeneralRe: Stream closes while reading a socket Pin
Paulo Zemek22-Nov-09 7:44
mvaPaulo Zemek22-Nov-09 7:44 
AnswerRe: Stream closes while reading a socket Pin
Luc Pattyn20-Nov-09 6:27
sitebuilderLuc Pattyn20-Nov-09 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.