1 страниц (5 вхождений)
Function with range results - Сообщения
#1 Опубликовано: 28.09.2023 11:52:31
#2 Опубликовано: 28.09.2023 12:35:00
#3 Опубликовано: 28.09.2023 13:50:33
Thank you very much. At least there is a work around!
#4 Опубликовано: 28.09.2023 19:59:28
WroteHi. Looks like a bug ...
Or not. It depends on how x^3 is interpreted. If the usual recursive definition is used, x^3 = (x^2)*x, then x^2 = x*x would be a dot product, while x^3 = (x*x) *x would be the product of a scalar times a vector, and the SMath result would be correct, although perhaps not the 'expected' one.
Best regards.
Alvaro.
#5 Опубликовано: 29.09.2023 12:13:04
Greetings,
Just as a note of 'Good Programming'; don't use the same variable when defining your declaring your function as you are passing into said variable for evaluation.
For example:
This way you can keep local and global variables separate and avoid confusion. I've had instances where local variables became global, and I accidently used a global variable locally. Else, you end up asking yourself "which x is being using? x as in the variable or x as in the parameter of the function?"
May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
Just as a note of 'Good Programming'; don't use the same variable when defining your declaring your function as you are passing into said variable for evaluation.
For example:
- instead of f(x):=x³ and x:=[0,1..3] and f(x)=▮;
- declare f(_z):=_z³ and x:=[0,1..3] and f(x)=▮;
This way you can keep local and global variables separate and avoid confusion. I've had instances where local variables became global, and I accidently used a global variable locally. Else, you end up asking yourself "which x is being using? x as in the variable or x as in the parameter of the function?"
May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
2 пользователям понравился этот пост
1 страниц (5 вхождений)
-
Новые сообщения
-
Нет новых сообщений