|
|
back to boardWhat's wrong with my formula?! Readln(n); Readln(ss); delete(ss,pos('.',ss),1); Val(ss,s,r); Readln(ss); delete(ss,pos('.',ss),1); Val(ss,l,r); count:=(s div l)*n+((s mod l)*n) div l+1; Please... Re: What's wrong with my formula?! Posted by Sid 25 Jun 2006 18:06 Precision is main trouble of this problem =) OK, but I don't Use real types... Can U give me the test to improve my program? Re: OK, but I don't Use real types... Can U give me the test to improve my program? Posted by Sid 25 Jun 2006 22:20 I will try to explain... When you read real number, for example 1.115, after reading you can get something like 1.11499999, and after custing to integer you'll get 1114 instead 1115. Just try different tests. Re: But I read String! Posted by Sid 26 Jun 2006 11:47 Just give me your e-mail and I'll send you c++ source. Re: But I read String! I don't need your code! I want to understand mistake in my formula! Well. OK, Ok... you've talked me in :) _magistr.90@mail.ru |
|
|