Recursive functions not working

Recursive functions not working - Recursive functions not working - 消息

#1 已发布: 2022/11/30 08:53:58
S0lo

S0lo

0个赞,共11个帖子。

组: 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 已发布: 2022/11/30 09:40:43
Arie

Arie

94个赞,共285个帖子。

组: 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位用户喜欢此帖子
sergio 2022/11/30 11:16:00
#3 已发布: 2022/11/30 09:48:02
Arie

Arie

94个赞,共285个帖子。

组: 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 已发布: 2022/11/30 14:11:53
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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位用户喜欢此帖子
Arie 2022/11/30 21:21:00
#5 已发布: 2022/11/30 15:21:42
S0lo

S0lo

0个赞,共11个帖子。

组: 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 已发布: 2022/11/30 18:10:45
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

The Mathematica 4.0 Fibonacci recursion has Smath companion algo style.

Recursive Fibonacci.PNG
#7 已发布: 2022/11/30 21:57:13
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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位用户喜欢此帖子
sergio 2022/12/1 11:41:00, Davide Carpi 2022/12/1 17:17:00
#8 已发布: 2022/12/1 14:42:17
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Maths Sqrt(x) Heron DEMO.sm (11.66 KiB)已下载 1598 次。
#9 已发布: 2022/12/1 22:09:52
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

Maths Sqrt(x) Heron DEMO.sm (11.66 KiB)已下载 1598 次。



Either.

recursive_versus_iterative.gif

recursive_versus_iterative.sm (40.78 KiB)已下载 1668 次。

Alvaro.
2位用户喜欢此帖子
NDTM Amarasekera 2022/12/1 23:01:00, churichuro 2022/12/2 01:00:00
  • 有新帖
  • 无新帖