Recursive functions not working

Recursive functions not working - Recursive functions not working - Messages

#1 Posted: 11/30/2022 8:53:58 AM
S0lo

S0lo

0 likes in 11 posts.

Group: User

I'm not sure, but I think I might have found a bug:

Noname.jpg

I remember this used to work before. Am I doing something wrong?
#2 Posted: 11/30/2022 9:40:43 AM
Arie

Arie

93 likes in 285 posts.

Group: User

Wrote

I'm not sure, but I think I might have found a bug:

error

I remember this used to work before. Am I doing something wrong?



You need to use line operator in function definition.

2022-11-30 07_40_07-SMath Solver - [Worksheet1_].png

Edit: A note about recursion. I do believe that Andrey limited the recursion depth that can take place. I think its somewhere around 50.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 users liked this post
sergio 11/30/2022 11:16:00 AM
#3 Posted: 11/30/2022 9:48:02 AM
Arie

Arie

93 likes in 285 posts.

Group: User

Example of recursion limit.

2022-11-30 07_47_11-SMath Solver - [Worksheet1_].png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#4 Posted: 11/30/2022 2:11:53 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. Every CAS should have a recursion limit. The point would be to be able to control it, like in Mathematica: https://reference.wolfram.com/language/ref/$RecursionLimit.html

Best regards.
Alvaro.
1 users liked this post
Arie 11/30/2022 9:21:00 PM
#5 Posted: 11/30/2022 3:21:42 PM
S0lo

S0lo

0 likes in 11 posts.

Group: User

Wrote

Wrote

I'm not sure, but I think I might have found a bug:

error

I remember this used to work before. Am I doing something wrong?



You need to use line operator in function definition.

2022-11-30 07_40_07-SMath Solver - [Worksheet1_].png

Edit: A note about recursion. I do believe that Andrey limited the recursion depth that can take place. I think its somewhere around 50.



Thanks!! How did I forget that. heh.

#6 Posted: 11/30/2022 6:10:45 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

The Mathematica 4.0 Fibonacci recursion has Smath companion algo style.

Recursive Fibonacci.PNG
#7 Posted: 11/30/2022 9:57:13 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

The Mathematica 4.0 Fibonacci recursion has Smath companion algo style.

Recursive Fibonacci.PNG



That is not an example of recursion, that is an iterative method. Try googling something like "iterative vs recursive Fibonacci".

Alvaro.
2 users liked this post
sergio 12/1/2022 11:41:00 AM, Davide Carpi 12/1/2022 5:17:00 PM
#8 Posted: 12/1/2022 2:42:17 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Maths Sqrt(x) Heron DEMO.sm (11 KiB) downloaded 28 time(s).
#9 Posted: 12/1/2022 10:09:52 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote

Maths Sqrt(x) Heron DEMO.sm (11 KiB) downloaded 28 time(s).



Either.

recursive_versus_iterative.gif

recursive_versus_iterative.sm (40 KiB) downloaded 37 time(s).

Alvaro.
2 users liked this post
NDTM Amarasekera 12/1/2022 11:01:00 PM, churichuro 12/2/2022 1:00:00 AM
  • New Posts New Posts
  • No New Posts No New Posts