[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: this programe is uncorrect
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 3 Jul 2014 15:58:45 +0200
On Thu, Jul 3, 2014 at 3:53 PM, zhujun <nj_zhujun@163.com> wrote:
> x=0
> total=10000000>
> for i=1 , total do
> x=x+0.01
> end
> y=0.01*total
> print(x)
> print(y)
> print(x==y)
I don't expect x==y to be true, because of small floating-point
errors. But I would expect them to be "pretty close" (i.e. that
abs(x-y) be small)