Rank: Newbie
Groups: Registered
Joined: 21/06/2010(UTC) Posts: 3
|
I report a situation that can be a source of errors. If you define the simple function: F(a):=I a:=a+3 I a and calculate F(1), using the "symbolic" optimization the result is 7; using the "numeric" optimization the result is 4. No error message is reported by the program. I think this situation must be clarified to avoid serious errors. Also, I have not found any document explaining how parameters are passed to a function (by reference, by value ...) Many thanks Ragnedda Edited by moderator 23 July 2010 23:35:35(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Ragnedda wrote: F(a):=I a:=a+3 I a
I can not understand this, sorry. Could you be more specific or try to use MATH tags - choose BB/ and MATH tag, please. Inside math tags, just copy and paste from SMath. Or, see some posts with math and choose "quote" to see the post source. You can see this post as well by "quote". Here is an example: F(a)←IF(a)—Ia←a+3I←aF(x)—3+xF(a)—9+aF(I)—12+aF(1)=4It might look a bit confusing and I am not sure if there is any use of this example. It is just a demonstration of SMath symbolic features. Ragnedda wrote: ...Also, I have not found any document explaining how parameters are passed to a function (by reference, by value ...)
Visit this link on the Wiki, please User functions. I hope that will clarify how is this working (including the above example). Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
omorr, thanks. Ragnedda, as I understood you are talking about F(a):line(a:a+3,a,2,1)Ragnedda wrote:and calculate F(1) To say truth I've never tested SMath Studio with lines and loops at right part of math expressions. The behavior you are mentioned was not even designed by me... it is what it is, so it is a bug, that SMath Studio is not raises an error on such expressions. Ragnedda wrote:Also, I have not found any document explaining how parameters are passed to a function (by reference, by value ...) All the arguments passes to functions by value. Best regards.
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Please refer to this post concerning functions and lines http://en.smath.info/forum/default.aspx?g=posts&m=2971#post2971I continued to play with it, and here are the results: I think this is Ragnedda problem reproduced: Here is some more: To be honest, I got confused now after all of these examples smath wrote: To say truth I've never tested SMath Studio with lines and loops at right part of math expressions. The behavior you are mentioned was not even designed by me... it is what it is, so it is a bug, that SMath Studio is not raises an error on such expressions.
I am convinced, Andrey, that you will pay attention to this as soon as you can. I think that we will get the multiline functions working properly by solving this Regards, Radovan Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Another simple test. Literal index, function as function arguments, multiline function (almost...) As mentioned before. It is almost everything Ok. The variable "n" is problematic. It was defined twice ???, therefore it is "global" variable, seen outside the function "F". Variable "y" is "local" - not seen outside the function. It serves here to return the result. As Andrey said, it is as it is - at the moment. I hope something could be done in the future about the problems mentioned in these posts. It would be a rather great improvement. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.