Recursive functions not working

Recursive functions not working - Recursive functions not working - Сообщения

#1 Опубликовано: 30.11.2022 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 Опубликовано: 30.11.2022 09:40:43
Arie

Arie

93 сообщений из 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 30.11.2022 11:16:00
#3 Опубликовано: 30.11.2022 09:48:02
Arie

Arie

93 сообщений из 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 Опубликовано: 30.11.2022 14:11:53
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 30.11.2022 21:21:00
#5 Опубликовано: 30.11.2022 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 Опубликовано: 30.11.2022 18:10:45
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

The Mathematica 4.0 Fibonacci recursion has Smath companion algo style.

Recursive Fibonacci.PNG
#7 Опубликовано: 30.11.2022 21:57:13
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 01.12.2022 11:41:00, Davide Carpi 01.12.2022 17:17:00
#8 Опубликовано: 01.12.2022 14:42:17
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Maths Sqrt(x) Heron DEMO.sm (11 КиБ) скачан 66 раз(а).
#9 Опубликовано: 01.12.2022 22:09:52
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: User

Wrote

Maths Sqrt(x) Heron DEMO.sm (11 КиБ) скачан 66 раз(а).



Either.

recursive_versus_iterative.gif

recursive_versus_iterative.sm (40 КиБ) скачан 82 раз(а).

Alvaro.
2 пользователям понравился этот пост
NDTM Amarasekera 01.12.2022 23:01:00, churichuro 02.12.2022 01:00:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений