<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;}
span.EmailStyle22
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Hello all, <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Nice implementation ! IMHO `double()` might also be extended to support a string, do you expect any other functions to be impacted by “string interpretation” on type conversion ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>--<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'>Clément<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> dev <dev-bounces@lists.scilab.org> <b>On Behalf Of </b>Antoine ELIAS<br><b>Sent:</b> Saturday, October 27, 2018 8:29 PM<br><b>To:</b> dev@lists.scilab.org<br><b>Subject:</b> Re: [Scilab-Dev] Big literal integers for int64() and uint64()<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hello again,<br>I worked on it ( challenge accepted ! )<br><br>I took a look of your implementation, I'm not sure it is necessary to remove trailing white spaces or inner spaces ( " 1 000 000 " is not a correct representation of a number, that's all ! )<br>Or you have to manage "\t", "," or any localized separator.<br><br>In lot of language when you convert "123toto" you get 123 not an error.<br>And does not allow "1.123" is a mistake for me since uint64(1.123) -> 1(ui64).<br><br>I made an implementation in builtin for all (u)int functions that raises error only on too long input string ("10000000000000000000" for example ) and empty string ( but we can convert to 0 like %nan )<br>I manage "nan", "NaN" "%nan", "inf", "Inf", "%inf", "-inf", "-Inf", "-%inf" to respectively 0, minval and maxval<br>And "icing on the cake", is little bit faster than yours :p<br>(between 2 and 100 times depending of input size, C++ vs script)<br><br>(missing NRT, changes ... but it is Saturday ^^ )<br><a href="https://codereview.scilab.org/#/c/20587/">https://codereview.scilab.org/#/c/20587/</a><br><br>Regards,<br>Antoine<o:p></o:p></p><div><p class=MsoNormal>Le 27/10/2018 à 17:34, Samuel Gougeon a écrit :<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Hello Antoine,<br><br>Thanks for your answer.<br>I have opened a bug report <a href="http://bugzilla.scilab.org/show_bug.cgi?id=15837">#15837</a> about this topic.<br><br>About the overload:<br><br>Le 27/10/2018 à 14:00, Antoine ELIAS a écrit :<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hello Samuel,<br><br>Currently, parser ... lexer, in fact, try to read "number" and convert it to floating point number, at this moment, we have no idea what the final goal of this number.<br>After that, the parser try to understand what to do with this number (already a double).<br>So I think the first case is not possible with the current management of numbers.<br><br>For string argument, I think it cannot be done easily in an overload macro for the same reason.<o:p></o:p></p></blockquote><p class=MsoNormal><br>In the report, i have posted a proposal for a working 11-rows-long %c_uint64() overload (without the error messages ;)<br>With it, we get for instance<br><br><tt><span style='font-size:10.0pt'>--> %c_uint64("9000000000000001000") + [ 1 -1001 ; 4 7]</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt> ans  =</tt><br><tt>  9000000000000001001  8999999999999999999</tt><br><tt>  9000000000000001004  9000000000000001007</tt><br></span><br>whereas<br><tt><span style='font-size:10.0pt'>--> uint64(9000000000000001000) + [ 1 -1001 ; 4 7]</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt> ans  =</tt><br><tt>  9000000000000001025  9000000000000000023</tt><br><tt>  9000000000000001028  9000000000000001031</tt><br></span><br>It can process any relevant input array of any number of dimensions.<br><br>Best regards<br>Samuel<br><br><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>dev mailing list<o:p></o:p></pre><pre><a href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>