Brandon Lewis

Brandon Lewis

  • NA
  • 527
  • 126k

Odd double Variable

Jun 25 2007 7:00 PM

I am building a console application that seems to be pulling a lovely trick on me. I ask for a small double number from the prompt and then it sticks that data into a double variable.
Well, when it does this, sayyyy... the number is 2.55, it loads in into the variable as 2.49999999998. Why does it do this? Its really messing with my calculations and I cant find a suitable fix for it.

Brandon


Answers (4)