Problem with while function

Problem with while function - 消息

#1 已发布: 2009/2/16 23:24:49
dominator86

dominator86

0个赞,共5个帖子。

组: User

I'm not sure but I think it's a bug. I tried to use the while function and when I want to converge a number to a constant there is no problem. But when I want to converge two numbers to each other like below, the program stops working.

Example:

x:=0
a:=20-2*x
b:=15-x
while a>b x:=x+1
#2 已发布: 2009/2/16 23:54:23
Andrey Ivashov

Andrey Ivashov

2,344个赞,共4,057个帖子。

组: Super Administrator

This is not a bug.
Second line (a:=20-2*x) program calculate as a:=20, becouse you've define x:=0; third line has similar result, so your condition in while loop is allways true.

Here is solution:

(download an example)
  • 有新帖
  • 无新帖