1 страниц (5 вхождений)
Operators behavior? - Сообщения
#1 Опубликовано: 28.07.2010 02:53:50
Hello,
This is some minor issues about operators and assignment in SMath.
Here are some examples:
[MATH]{{a←5}/{b←a+1}}/{c←b+4}[/MATH]
========
[MATH]sqrt({aa←100}/{cc←800})[/MATH]
========
[MATH]det({v←110}/{u←1000})[/MATH]
========
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
This is some minor issues about operators and assignment in SMath.
Here are some examples:
[MATH]{{a←5}/{b←a+1}}/{c←b+4}[/MATH]
========
[MATH]sqrt({aa←100}/{cc←800})[/MATH]
========
[MATH]det({v←110}/{u←1000})[/MATH]
========
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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#2 Опубликовано: 28.07.2010 14:26:18
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.

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

Ed
#3 Опубликовано: 28.07.2010 16:03:35
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
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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 Опубликовано: 28.07.2010 18:49:02
Hello.
This is a bug. Definition operator should return the right side of expression, so in

answer for "x" should be 10.
Regards.
This is a bug. Definition operator should return the right side of expression, so in

answer for "x" should be 10.
Regards.
#5 Опубликовано: 29.07.2010 02:10:36
Hello Andrey,
Just one more comment - hope you would not mind.
This syntax is incorrect (error message):
[MATH]a←b←5[/MATH]
With this one the syntax is correct but gives problematic and questionable results:
[MATH]a←(b←5)[/MATH]
[MATH]a=0[/MATH] [MATH]b=5[/MATH]
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
Just one more comment - hope you would not mind.
This syntax is incorrect (error message):
[MATH]a←b←5[/MATH]
With this one the syntax is correct but gives problematic and questionable results:
[MATH]a←(b←5)[/MATH]
[MATH]a=0[/MATH] [MATH]b=5[/MATH]
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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 страниц (5 вхождений)
-
Новые сообщения
-
Нет новых сообщений