Welcome Guest Search | Active Topics | Log In | Register

Operators behavior?
omorr Offline
#1 Posted : Wednesday, July 28, 2010 9:53:50 AM(UTC)
Rank: Advanced Member

Groups: Registered, Advanced Member

Joined: 6/23/2009(UTC)
Posts: 368
Location: Serbia
Hello,

This is some minor issues about operators and assignment in SMath.
Here are some examples:

========

========

========
They reported "Division by zero." error but the assigment is performed and every variables has their values. For instance, try to use matrix operator and fill the placeholders with asignments. No error reported, but assignmnets are performed.

I do not know what to think about it. This might just be ignored (no harm done) or just force SMath to supress this. What others think about it?

Regards,
Radovan
TheWizEd Offline
#2 Posted : Wednesday, July 28, 2010 9:26:18 PM(UTC)
Rank: Advanced Member

Groups: Registered

Joined: 7/4/2010(UTC)
Posts: 51
Location: Hercules, Ca. USA
The examples you show are not critical because the division by zero seems to suppress any result of the operator. I could not get the sqrt of aa/cc with the "=" key.

However a more critical case is shown in the example below where the result is incorrect.

omorr Offline
#3 Posted : Wednesday, July 28, 2010 11:03:35 PM(UTC)
Rank: Advanced Member

Groups: Registered, Advanced Member

Joined: 6/23/2009(UTC)
Posts: 368
Location: Serbia
Yes, I agree. However, I still do not have any definite opinion about this. Here is another example, symilar to yours.

No errors reported as well. As you would expect variable "x" to have value of 10, I would expect some other values for the variables in this example. I do not know how to explain this and how is this actually working. On the other hand, I think it might be useful if the results would be predictible.

Regards,
Radovan
smath Offline
#4 Posted : Thursday, July 29, 2010 1:49:02 AM(UTC)
Rank: Administration

Groups: Administrators

Joined: 7/11/2008(UTC)
Posts: 476
Location: St. Petersburg
Hello.

This is a bug. Definition operator should return the right side of expression, so in

answer for "x" should be 10.

Regards.
omorr Offline
#5 Posted : Thursday, July 29, 2010 9:10:36 AM(UTC)
Rank: Advanced Member

Groups: Registered, Advanced Member

Joined: 6/23/2009(UTC)
Posts: 368
Location: Serbia
Hello Andrey,

Just one more comment - hope you would not mind.

This syntax is incorrect (error message):

With this one the syntax is correct but gives problematic and questionable results:


In the first place, I was thinking that multiple assignments are problematic but I remembered that, i.e., this is quite correct:

SMath must have multiple assignments in the same math region. On the other hand I commented the issue about "local" and "global" variables - problematic "line" environment in few posts:
http://en.smath.info/forum/default.aspx?g=posts&m=3113#post3113
http://en.smath.info/forum/default.aspx?g=posts&m=3114#post3114

Then I remembered that Mathcad does not allow multiple assignments. I suppose because of the similar problems. In Mathcad inside the "line" blocks there are "local assignments" - left arrow character - used instead ordinary (:=) assignment operator. However, I would like very much SMath to have the functionality of multiple functions with "line" and programming (above are the mentioned posts about the present situation). At the moment I do not know how to deal with it. I feel that the solution is right there and SMath is close to it. Of course, this is just my impression.

Regards,
Radovan
Users browsing this topic
Guest
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.