[Scilab-users] {EXT} Re: display of complex/not real numbers, again
Stéphane Mottelet
stephane.mottelet at utc.fr
Fri Sep 13 15:21:37 CEST 2019
Le 13/09/2019 à 15:13, Dang Ngoc Chan, Christophe a écrit :
> Hello,
>
>> De : Stéphane Mottelet
>> Envoyé : vendredi 13 septembre 2019 14:23
>>
>> I think that we do agree about the fact that the actual Scilab display
>> [...]
>> --> x(8)
>> ans =
>>
>> 1.7
>> --> x(8)-1.7
>> ans =
>>
>> 2.220D-16
>> is pretty but not correct/homogeneous/honest
Maybe I was not clear enough.
1.7 cannot be stored exactly in IEEE754 encoding so it should always be
displayed with trailing zeros.
So
--> x(8)-1.7
ans =
2.220D-16
is OK and should always be displayed like this, but the previous display
--> x(8)
ans =
1.7
is not OK. What is not correct/homogeneous/honest is the fact that we have this both displays in the current version of Scilab.
> I don't agree about this.
> The decimal number can only rarely be represented exactly in binary according to IEEE 754.
>
> This means that there should always be trailing zeros to highlight the fact that there is a 10^-16 discrepancy between the stored value and the displayed value?
> I don't find this convenient.
>
> The fact that some people are not aware of this discrepancy can be a problem but it is the general problem of underflow or subtractive cancellation or round-off error etc.
>
> The problem is not less important than ignoring a number is complex with a zero imaginary part, but I'm not sure it can be handled in the same way.
>
> --
> Christophe Dang Ngoc Chan
> Mechanical calculation engineer
>
> General
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet
More information about the users
mailing list