Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Secure Data Exchange Between WinfForm app and Web Service Pin
#realJSOP5-Sep-08 0:20
mve#realJSOP5-Sep-08 0:20 
GeneralRe: Secure Data Exchange Between WinfForm app and Web Service Pin
leppie5-Sep-08 3:50
leppie5-Sep-08 3:50 
Questiondouble Pin
RugbyLeague4-Sep-08 2:20
RugbyLeague4-Sep-08 2:20 
AnswerRe: double [modified] Pin
c24234-Sep-08 2:51
c24234-Sep-08 2:51 
AnswerRe: double Pin
RugbyLeague4-Sep-08 2:52
RugbyLeague4-Sep-08 2:52 
AnswerRe: double Pin
Mbah Dhaim4-Sep-08 2:53
Mbah Dhaim4-Sep-08 2:53 
AnswerRe: double Pin
DaveyM694-Sep-08 3:11
professionalDaveyM694-Sep-08 3:11 
GeneralRe: double [modified] Pin
#realJSOP4-Sep-08 3:27
mve#realJSOP4-Sep-08 3:27 
First, you don't need the "d" notation after the numbers (and you could initialize d like so: double d = 0.0;.

Next, floating point math is not precise. Since a CPU is inherently an integer processor, performing floating point math results in an approximation.

Try using decimal for the math, and then cast it to a double.

decimal d = 0.0m;
d += 0.0963m;
d += 0.0029m;
d += 0.0654m;
d += 0.0386m;
d += 0.0526m;
    double d2 = Convert.ToDouble(d);



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


modified on Thursday, September 4, 2008 9:34 AM

GeneralRe: double Pin
Dan Neely4-Sep-08 4:32
Dan Neely4-Sep-08 4:32 
QuestionPanel screencapture is black in invisible part of panel Pin
joost.versteegen4-Sep-08 2:05
joost.versteegen4-Sep-08 2:05 
AnswerRe: Panel screencapture is black in invisible part of panel Pin
leppie4-Sep-08 9:02
leppie4-Sep-08 9:02 
GeneralRe: Panel screencapture is black in invisible part of panel Pin
joost.versteegen4-Sep-08 23:11
joost.versteegen4-Sep-08 23:11 
GeneralRe: Panel screencapture is black in invisible part of panel Pin
leppie4-Sep-08 23:47
leppie4-Sep-08 23:47 
GeneralRe: Panel screencapture is black in invisible part of panel Pin
joost.versteegen9-Sep-08 20:27
joost.versteegen9-Sep-08 20:27 
QuestionPlease help with Serial Communication [modified] Pin
introuble24-Sep-08 2:00
introuble24-Sep-08 2:00 
AnswerRe: Please help with Serial Communication Pin
Gideon Engelberth4-Sep-08 3:05
Gideon Engelberth4-Sep-08 3:05 
GeneralRe: Please help with Serial Communication Pin
introuble24-Sep-08 3:32
introuble24-Sep-08 3:32 
GeneralRe: Please help with Serial Communication Pin
Mbah Dhaim4-Sep-08 10:12
Mbah Dhaim4-Sep-08 10:12 
GeneralRe: Please help with Serial Communication Pin
Gideon Engelberth4-Sep-08 12:32
Gideon Engelberth4-Sep-08 12:32 
GeneralRe: Please help with Serial Communication Pin
introuble24-Sep-08 22:23
introuble24-Sep-08 22:23 
GeneralRe: Please help with Serial Communication [modified] Pin
introuble217-Sep-08 22:22
introuble217-Sep-08 22:22 
GeneralRe: Please help with Serial Communication Pin
introuble217-Sep-08 22:37
introuble217-Sep-08 22:37 
QuestionSecuring DLL Pin
Member 40066484-Sep-08 1:10
Member 40066484-Sep-08 1:10 
AnswerCross Post. Please ignore. Pin
Pete O'Hanlon4-Sep-08 1:51
mvePete O'Hanlon4-Sep-08 1:51 
Questionread a specified element in the xml file Pin
prasadbuddhika4-Sep-08 0:57
prasadbuddhika4-Sep-08 0:57 

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.