Math issue?

  • Thread starter Thread starter David A. Osborn
  • Start date Start date
D

David A. Osborn

I'm doing the below calculating in VB.net. All variable are declared as
double and their contents are below.


mdblMidtermWt 0.2 Double
mdblFinalWt 0.2 Double
mdblAssignWt 0.2 Double
mdblGroupWt 0.3 Double
mdblPartWt 0.1 Double

temp 1.0000000000000002 Double


temp = mdblMidtermWt + mdblFinalWt + mdblAssignWt + mdblGroupWt + mdblPartWt

Last I check 0.2 + 0.2 + 0.2+0.3 + 0.1 was equal to 1 so why am I getting
1.0000000000000002 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top