Infinite loop problem?

Infinite loop problem? - 消息

#1 已发布: 2010/8/6 17:05:07
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Hello Andrey,

I think this should be a bug.
[MATH]f(x)←5+f(x)[/MATH]
[MATH]f(1)=#[/MATH]
This will not stop executing until it is interrupted. I think this is an infinite loop problem.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#2 已发布: 2010/8/6 20:18:55
Andrey Ivashov

Andrey Ivashov

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

组: Super Administrator

Hello.

Thank you. Will check this later.

Regards.
#3 已发布: 2010/8/18 06:55:06
Greg Locock

Greg Locock

0个赞,共53个帖子。

组: User

what behaviour would you expect?

you are asking for 5+5+5....
#4 已发布: 2010/8/18 07:27:35
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Wrote

what behaviour would you expect?

you are asking for 5+5+5....


Yes, Greg, that is the problem. We can have something like this:
[MATH lang=eng]f(x)←x[/MATH]
[MATH lang=eng]f(x)←f(x)/2[/MATH]
[MATH lang=eng]f(5)=2.5[/MATH]
But with this, we get in trouble.
[MATH lang=eng]f(x)←f(x)/2[/MATH]
[MATH lang=eng]f(5)=#@#[/MATH]
The question is - Does it to be the user's problem to interrupt such a calculation or to suppress it by an error message? I was not sure about it, and that was my doubt about "endless loop".

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 已发布: 2010/9/29 18:11:03
Andrey Ivashov

Andrey Ivashov

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

组: Super Administrator

Fixed.

#6 已发布: 2010/9/30 03:10:33
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Hello Andrey,

Sorry for being persistent, but I think I was not precise enough. The previous calculation will work in SMath - there was not a problem.
But, try this:

The problem is that this will never stop, until we "Interrupt processing". My question was - Should it be left this way or should it be stopped by SMath.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#7 已发布: 2010/9/30 08:52:55
Andrey Ivashov

Andrey Ivashov

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

组: Super Administrator

This is also fixed. Now SMath Studio understands that it is not good practice to repeat substitution of the already substituted functions with the same names So one will not see infinite loops in such cases anymore.

Regards.
1位用户喜欢此帖子
Radovan Omorjan 2010/9/30 09:05:00
  • 有新帖
  • 无新帖