Infinite loop problem?

Infinite loop problem? - Mensajes

#1 Publicado: 6/8/2010 17:05:07
Radovan Omorjan

Radovan Omorjan

325 me gusta y 1 no me gusta en 2.052 mensajes.

Grupo: 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 Publicado: 6/8/2010 20:18:55
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

Hello.

Thank you. Will check this later.

Regards.
#3 Publicado: 18/8/2010 6:55:06
Greg Locock

Greg Locock

0 me gusta en 53 mensajes.

Grupo: User

what behaviour would you expect?

you are asking for 5+5+5....
#4 Publicado: 18/8/2010 7:27:35
Radovan Omorjan

Radovan Omorjan

325 me gusta y 1 no me gusta en 2.052 mensajes.

Grupo: 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 Publicado: 29/9/2010 18:11:03
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

Fixed.

#6 Publicado: 30/9/2010 3:10:33
Radovan Omorjan

Radovan Omorjan

325 me gusta y 1 no me gusta en 2.052 mensajes.

Grupo: 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 Publicado: 30/9/2010 8:52:55
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: 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.
A 1 usuarios les gustó este mensaje
Radovan Omorjan 30/9/2010 9:05:00
  • Nuevos mensajes
  • Sin mensajes nuevos