0

I am trying to add -ve to double

List<double> values={12.34,-12}
double value =0.00;
for(double b: values)
{

value += b;
}

I am expecting value of b =0.34 but it returning me 0.399999999985

any idea why it is returning me the wrong value.

sree
  • 868
  • 2
  • 12
  • 35

0 Answers0