<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
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 class="moz-txt-link-freetext" href="https://codereview.scilab.org/#/c/20587/">https://codereview.scilab.org/#/c/20587/</a><br>
<br>
Regards,<br>
Antoine<br>
<div class="moz-cite-prefix">Le 27/10/2018 à 17:34, Samuel Gougeon a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:9de6a4ab-c0ef-af8b-91c1-dd875d8a524a@free.fr">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix">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"
moz-do-not-send="true">#15837</a> about this topic.<br>
<br>
About the overload:<br>
<br>
Le 27/10/2018 à 14:00, Antoine ELIAS a écrit :<br>
</div>
<blockquote
cite="mid:2c5d75e4-5bed-fc9e-47d8-91f92471c281@scilab-enterprises.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
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.<br>
</blockquote>
<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>--> %c_uint64("9000000000000001000") + [ 1 -1001 ; 4 7]</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt> 9000000000000001001 8999999999999999999</tt><tt><br>
</tt><tt> 9000000000000001004 9000000000000001007</tt><tt><br>
</tt><br>
whereas<br>
<tt>--> uint64(9000000000000001000) + [ 1 -1001 ; 4 7]</tt><tt><br>
</tt><tt> ans =</tt><tt><br>
</tt><tt> 9000000000000001025 9000000000000000023</tt><tt><br>
</tt><tt> 9000000000000001028 9000000000000001031</tt><tt><br>
</tt><br>
It can process any relevant input array of any number of
dimensions.<br>
<br>
Best regards<br>
Samuel<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/dev">http://lists.scilab.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<br>
</body>
</html>