[CAS] Detection of errors in the program editor
|
10-19-2016, 12:16 AM
Post: #1
|
|||
|
|||
[CAS] Detection of errors in the program editor
Hello,
1: why the sentence "if ( (a:= 5) and true) then" this has the final state TRUE?, the left side of the comparison is an assignment, why evaluates to true? PHP Code: #cas test( ); returns "YES" |
|||
10-19-2016, 01:52 AM
Post: #2
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
ok
now (a = 5) and true -> false, why? PHP Code: #cas test( ); returns "NO" |
|||
10-19-2016, 03:24 AM
Post: #3
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
for CAS use a == 5
Viga C | TD | FB |
|||
10-19-2016, 03:37 AM
Post: #4
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
it may be that a user instead of typing ( == ) write one equal ( = ), then that means for the CAS (var = number)?
|
|||
10-20-2016, 05:26 PM
(This post was last modified: 10-20-2016 05:28 PM by toml_12953.)
Post: #5
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(10-19-2016 12:29 PM)moonbeam Wrote:(10-19-2016 03:24 AM)Carlos295pz Wrote: for CAS use a == 5 A single = also works as a test for equality in non-CAS mode. Maybe it's not supposed to work but it does. Try it. Code: A:=5; Tom L Tom L Cui bono? |
|||
10-20-2016, 06:06 PM
(This post was last modified: 10-20-2016 06:13 PM by compsystems.)
Post: #6
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(CAS HPP-PL) Programming Language of the calculator HP-Prime CAS mode
PHP Code: #cas -> 5=6 //ok a=5 //ok the following statement the (CAS HPP-PL) compiler must detect the error PHP Code: ... |
|||
10-20-2016, 07:39 PM
Post: #7
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
PHP Code: 5=6 o a=5 //Son ecuaciones permitidas por CAS PHP Code: a=5 AND true //Error, ecuación AND lógico no es compatible. El operador relacional de igualdad en HOME puede ser = o ==, pero en CAS es distinto, en CAS el = se usa para definir ecuaciones de acuerdo a su contexto, se debe usar == para obtener un resultado relacional como true o false. Viga C | TD | FB |
|||
10-20-2016, 08:05 PM
Post: #8
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(10-20-2016 06:06 PM)compsystems Wrote: the following statement the (CAS HPP-PL) compiler must detect the error Why? I can perfectly well determine if that is true or not. If a is not equal to 5, then it is false... TW Although I work for HP, the views and opinions I post here are my own. |
|||
10-20-2016, 08:17 PM
(This post was last modified: 10-20-2016 08:19 PM by compsystems.)
Post: #9
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(10-20-2016 07:39 PM)Carlos295pz Wrote:pero que pasa si me equivoco al digitar, el lugar de DOBLE IGUAL coloco un SOLO IGUAL dentro de un codigo CAS, el compilador no detecta esto. un código que estoy realizando me llevo mucho tiempo descubrir el problema, Insisto que hay problema en el compilador o no? ademas el signo igual tampoco es asignación, el operador asignación es := In the next case if it detects the error in the statement "if( a and true) then" when run program PHP Code: #cas "Ifte: Unable to check test Error: Bad Argument Value" It displays a message but should go to the code to show the line where occurred |
|||
10-20-2016, 08:22 PM
Post: #10
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(10-20-2016 08:05 PM)Tim Wessman Wrote:(10-20-2016 06:06 PM)compsystems Wrote: the following statement the (CAS HPP-PL) compiler must detect the error if 'a' is not defined I can not say anything purge(a); 'a' not contain any object a=5,It is indeterminate and no false |
|||
10-20-2016, 10:30 PM
(This post was last modified: 10-20-2016 10:34 PM by Carlos295pz.)
Post: #11
|
|||
|
|||
RE: [CAS] Detection of errors in the program editor
(10-20-2016 08:17 PM)compsystems Wrote: ... Insisto que hay problema en el compilador o no? ademas el signo igual tampoco es asignación, el operador asignación es := ...1. Creo que sería confuso identificar al compilar CAS diferentes funcionalidades del signo "=", en CAS esta orientado netamente al método algebraico, para definir ecuacines. 2. Recordar que el CAS de prime, esta basado en el programa Xcas, por lo que tratan de seguir fielmente su sintaxis. 3. En CAS la asignación se realiza solo con ":=" o "▶", sólo en HOME es donde se puede usar como asignación en las líneas de declaración de variables (LOCAL Var1=5, Var2=10; ), en el resto de líneas se debe usar ":=". (10-20-2016 08:17 PM)compsystems Wrote: In the next case if it detects the error in the statement "if( a and true) then" when run program...1. (a and true), esto es correcto, porque de acuerdo al contenido de "a", de ser diferente de 0, será asumido como verdadero, por lo que no existiría error de sintaxis [valor_lógico and valor_lógico]. 2. Caso distinto es ( a=5 and true) //Error Viga C | TD | FB |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)