[scilab-Users] what am I doing wrong

A. Ismael F. Vaz aivaz at dps.uminho.pt
Wed Sep 14 15:36:37 CEST 2011


Hi,

This is better explained by using precedencies in mathematical expressions.
First we solve what's in parenthesis, then potentiation, then multiplication
and division, and in the end the summation and subtractions from left to
right.

In -10^2 the potentiation has priority over the subtraction.

In (-10)^2 the parenthesis has priority over the potentiation.

You obtain exactly the same behavior using a scientific calculator, in fact
I warn my students about this when I taught Numerical Methods.

Best regards,
Ismael

-----Mensagem original-----
De: Carrico, Paul [mailto:paul.carrico at esterline.com] 
Enviada: quarta-feira, 14 de Setembro de 2011 14:28
Para: users at lists.scilab.org
Assunto: RE: [scilab-Users] what am I doing wrong

Well

Imagine you're computing a function such as : f = x(1)^2 - x(2)^2 ... The
negative sign is not influence by the square, isn't it ?

Be rigorous in using parentheses ....

Paul


-----Message d'origine-----
De : Maso RICCI [mailto:ricci2 at unisi.it] Envoyé : mercredi 14 septembre 2011
15:25 À : users at lists.scilab.org Objet : Re: [scilab-Users] what am I doing
wrong

got it ...

thanks for helping me

but is it not a little confusing ?

/maso

Il 14/09/2011 15.20, Carrico, Paul ha scritto:
> Try (-10)^2
>
> Different from -1*10^2 == -1*(10)^2
>
> Paul
>
>
> Please consider the environment before printing this e-mail
>
>
> -----Message d'origine-----
> De : Maso RICCI [mailto:ricci2 at unisi.it] Envoyé : mercredi 14 
> septembre 2011 15:18 À : users at lists.scilab.org Objet : [scilab-Users] 
> what am I doing wrong
>
> Ehm... pretty sure I am going to place a dummy question
>
> but I got to do it:
>
> is it corret the below result from my scilab console ?
>
> -->-10^2
>    ans  =
>
>     - 100.
>
> thanks
>
> /maso
>

--
----------------------------------------
Maso RICCI PhD
Dipartimento Farmaco Chimico Tecnologico Università degli Studi di Siena Via
Aldo Moro,2 Siena

phone: +390577234367
email: ricci2 at unisi.it
----------------------------------------

----------------------------------------------------------------------------
----


Le présent mail et ses pièces jointes sont confidentiels et destinés à la
personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail
par erreur, veuillez contacter immédiatement l'expéditeur et effacer le
message de votre système. Toute divulgation, copie ou distribution de cet
e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please contact the sender and
delete the email from your system. If you are not the named addressee you
should not disseminate, distribute or copy this email.




More information about the users mailing list