Infinite loop problem?

Infinite loop problem? - Poruke

#1 Objavljeno: 6. 8. 2010. 17:05:07
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 6. 8. 2010. 20:18:55
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: Super Administrator

Hello.

Thank you. Will check this later.

Regards.
#3 Objavljeno: 18. 8. 2010. 06:55:06
Greg Locock

Greg Locock

0 svidjanja u 53 postova.

Grupa: User

what behaviour would you expect?

you are asking for 5+5+5....
#4 Objavljeno: 18. 8. 2010. 07:27:35
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 29. 9. 2010. 18:11:03
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: Super Administrator

Fixed.

#6 Objavljeno: 30. 9. 2010. 03:10:33
Radovan Omorjan

Radovan Omorjan

325 svidjanja i 1 nesvidjanja u 2.052 postova.

Grupa: 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 Objavljeno: 30. 9. 2010. 08:52:55
Andrey Ivashov

Andrey Ivashov

2.345 svidjanja u 4.060 postova.

Grupa: 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 korisnika je svidelo ovu objavu
Radovan Omorjan 30. 9. 2010. 09:05:00
  • Novi postovi
  • Nema novih postova