[Scilab-users] A possible bug with format(width)

classic Classic list List threaded Threaded
10 messages Options
Iza Iza
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] A possible bug with format(width)

Hello,

When Scilab 6.0.2 became available I reported a crash while running my
program which worked fine on previous version:
http://mailinglists.scilab.org/Scilab-users-Scilab-crash-on-a-Windows-server-td4039065.html#a4039120
I managed to find out that the problem was about "format" which was
changed in the latest version of Scilab and wasn't working properly with
some numbers imported from Excel. Fortunately I edited my program and
now it works fine.
But I am still wondering if it's fine that Scilab crashes when width of
number in format is smaller than displayed number, for example:

u=123.456;
format(8)
u  =  123.456

format(7)
u  =  123.46

format(6)
u  =  123.5

format(5)
u  =  123.

With format(4) and attempt to display a variable u Scilab stops working.
Does everyone have such behaviour and isn't it a bug?

Kind regards,
Iza
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

Le 05/06/2019 à 16:38, Izabela Wójcik-Grząba a écrit :

> Hello,
>
> When Scilab 6.0.2 became available I reported a crash while running my
> program which worked fine on previous version:
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Scilab-crash-on-a-Windows-server-td4039065.html#a4039120 
>
> I managed to find out that the problem was about "format" which was
> changed in the latest version of Scilab and wasn't working properly
> with some numbers imported from Excel. Fortunately I edited my program
> and now it works fine.
> But I am still wondering if it's fine that Scilab crashes when width
> of number in format is smaller than displayed number, for example:
>
> u=123.456;
> format(8)
> u  =  123.456
>
> format(7)
> u  =  123.46
>
> format(6)
> u  =  123.5
>
> format(5)
> u  =  123.
>
> With format(4) and attempt to display a variable u Scilab stops
> working. Does everyone have such behaviour and isn't it a bug?
>
Under Scilab 6.0.2, MacOSX :

--> u=123.456;

--> format(4)

--> u
  u  =

    1.D+02

> Kind regards,
> Iza
> _______________________________________________
> users mailing list
> [hidden email]
> 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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Iza Iza
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

My computer works under Windows 7, 64bit.

Iza



W dniu 05.06.2019 16:55, Stéphane Mottelet napisał(a):

> Le 05/06/2019 à 16:38, Izabela Wójcik-Grząba a écrit :
>> Hello,
>>
>> When Scilab 6.0.2 became available I reported a crash while running my
>> program which worked fine on previous version:
>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Scilab-crash-on-a-Windows-server-td4039065.html#a4039120 
>> I managed to find out that the problem was about "format" which was
>> changed in the latest version of Scilab and wasn't working properly
>> with some numbers imported from Excel. Fortunately I edited my program
>> and now it works fine.
>> But I am still wondering if it's fine that Scilab crashes when width
>> of number in format is smaller than displayed number, for example:
>>
>> u=123.456;
>> format(8)
>> u  =  123.456
>>
>> format(7)
>> u  =  123.46
>>
>> format(6)
>> u  =  123.5
>>
>> format(5)
>> u  =  123.
>>
>> With format(4) and attempt to display a variable u Scilab stops
>> working. Does everyone have such behaviour and isn't it a bug?
>>
> Under Scilab 6.0.2, MacOSX :
>
> --> u=123.456;
>
> --> format(4)
>
> --> u
>  u  =
>
>    1.D+02
>
>> Kind regards,
>> Iza
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

In reply to this post by Iza
Hello Izabela,

Le 05/06/2019 à 16:38, Izabela Wójcik-Grząba a écrit :
.../...
With format(4) and attempt to display a variable u Scilab stops working. Does everyone have such behaviour and isn't it a bug?

Confirmed behavior on win7 64 bits. Sure it is a bug, a serious one.
You would be kind to report it on bugzilla.

Regards
Samuel

PS : the bug 14653 may also be considered.


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

As MacOSX, Linux is not affected, this will help to solve this bug:

Scilab 6.0.2 (Feb 14 2019, 10:11:47)

 

--> OS_Version

 ans  =

 

 Linux 4.15.0-48-generic

 

--> format(4); u=123.456

 u  = 

 

   1.D+02

S.

Quoting Samuel Gougeon <[hidden email]>:

Hello Izabela,
 
Le 05/06/2019 à 16:38, Izabela Wójcik-Grząba a écrit :

.../...
With format(4) and attempt to display a variable u Scilab stops working. Does everyone have such behaviour and isn't it a bug?

Confirmed behavior on win7 64 bits. Sure it is a bug, a serious one.
You would be kind to report it on bugzilla.

Regards
Samuel

PS : the bug 14653 may also be considered.
 




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

Le 05/06/2019 à 21:57, [hidden email] a écrit :

As MacOSX, Linux is not affected, this will help to solve this bug:

Scilab 6.0.2 (Feb 14 2019, 10:11:47) 

--> OS_Version

 ans  =

 Linux 4.15.0-48-generic 

--> format(4); u=123.456

 u  = 

   1.D+02


Are you in "v" format? This result looks like to be in "e" one, and anyway it does not comply with the required width.
On win7 with 5.5.2 we get in "v" format:
-->format(4); u=123.456
 u  =
   123. 
=> it does not switch to "e" format.


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

Scilab 6.0.1 does it as follows:
 
 --> format(4); u=123.456
  u  = 
  
    1.0  D+02
 
The display of Scilab 5.5.2 does not respect the format length either,  because " 123." has length 5 (blank sign +123 + dot)
 
S.


Quoting Samuel Gougeon <[hidden email]>:

Le 05/06/2019 à 21:57, [hidden email] a écrit :

 

As MacOSX, Linux is not affected, this will help to solve this bug:

Scilab 6.0.2 (Feb 14 2019, 10:11:47)

--> OS_Version

 ans  =

 Linux 4.15.0-48-generic

--> format(4); u=123.456

 u  = 

   1.D+02

 

Are you in "v" format? This result looks like to be in "e" one, and anyway it does not comply with the required width.
On win7 with 5.5.2 we get in "v" format:
-->format(4); u=123.456
 u  =
   123. 
=> it does not switch to "e" format.
 




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

This behavior (swith to "e") is logical. For example, with format("v",10), which is the default, 123456789 cannot be displayed in "v" mode with 10 characters. Hence, the only solution is to switch to "e" mode:

--> format("v",10)

--> 123456789
 ans  =

   1.235D+08

Of course, you cannot use less than 7 characters (3 chars for the signed mantissa and the dot and 4 chars for the exponent):

--> format("v",8)

--> 123456789
 ans  =

   1.2D+08


--> format("v",7)

--> 123456789
 ans  =

   1.D+08


--> format("v",6)

--> 123456789
 ans  =

   1.D+08



Le 05/06/2019 à 23:46, [hidden email] a écrit :
Scilab 6.0.1 does it as follows:
 
 --> format(4); u=123.456
  u  = 
  
    1.0  D+02
 
The display of Scilab 5.5.2 does not respect the format length either,  because " 123." has length 5 (blank sign +123 + dot)
 
S.


Quoting Samuel Gougeon <[hidden email]>:

Le 05/06/2019 à 21:57, [hidden email] a écrit :

 

As MacOSX, Linux is not affected, this will help to solve this bug:

Scilab 6.0.2 (Feb 14 2019, 10:11:47)

--> OS_Version

 ans  =

 Linux 4.15.0-48-generic

--> format(4); u=123.456

 u  = 

   1.D+02

 

Are you in "v" format? This result looks like to be in "e" one, and anyway it does not comply with the required width.
On win7 with 5.5.2 we get in "v" format:
-->format(4); u=123.456
 u  =
   123. 
=> it does not switch to "e" format.
 




_______________________________________________
users mailing list
[hidden email]
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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Iza Iza
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)

> This behavior (swith to "e") is logical.

Summing up: I should report a bug and suggest automatic switching to "e"
in such situation?

Iza
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: A possible bug with format(width)


Le 06/06/2019 à 10:02, Izabela Wójcik-Grząba a écrit :
>> This behavior (swith to "e") is logical.
>
> Summing up: I should report a bug and suggest automatic switching to
> "e" in such situation?
No. The switch is hard-coded independently of the platform and works
under Linux and Mac OS. So just report the crash with your example
>
> Iza

--
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

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users