hey all,<br>I got a problem with floats and calculations. I made an mini-application where you get random questions with some science calculations in it<br>So the user can type in his result with the values given by random creation. And the user value is compared against the computer value... the problem is that the user input is only 2 numbers behind the '.' so like 1.42, 1.75<br>
<br>here is the example:<br><a href="http://dpaste.com/hold/158698/">http://dpaste.com/hold/158698/</a><br><br>without decimal it would be very inaccurate. decimal is very accurate when I have to compare d with users calculations from a,b,c,var.<br>
But when I ask the user what is "a" the result gets inaccurate when calculating with the same values given before (b,c,d,var). <br><br>Maybe anyone can help me with this problem, I don't want to generate for every possible user input a single formula. And also it should be possible for a computer, my calculator at home does the same and is much smaller and slower. <br>
<br>thx in advance<br><br>Karsten<br>