1 Pages (5 items)
Function with range results - Messages
#1 Posted: 9/28/2023 11:52:31 AM
#2 Posted: 9/28/2023 12:35:00 PM
#3 Posted: 9/28/2023 1:50:33 PM
Thank you very much. At least there is a work around!
#4 Posted: 9/28/2023 7:59:28 PM
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 Posted: 9/29/2023 12:13:04 PM
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 users liked this post
1 Pages (5 items)
-
New Posts
-
No New Posts