SA-MP Forums Archive
Strval Bug ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Strval Bug ? (/showthread.php?tid=523940)



Strval Bug ? - Rittik - 04.07.2014

Whenever I try to convert some numerical values stored in a string to an Integer using strval, the output is totally different from the actual numerical values stored withing a string.

Example:
Input:
new string[128]=114105116116105107;
new bug = strval(string);

Output:

-1591232621

So, the output is totally different and it's a negative value.


Re : Strval Bug ? - S4t3K - 04.07.2014

You forgot quotes.

pawn Код:
new string[] = "114105116116105107";
new bug = strval(string);
printf("%s | %d", string, bug);



Re: Strval Bug ? - DarkZeroX - 04.07.2014

PHP код:
string est une chaine de caractиre
new string[256]:
string[0] = ?
string[1] = ?
...... 
250X
str is a string 
new str [256]: 
str [0] =? 
str [1] =? 
250X ...... 



AW: Strval Bug ? - Nero_3D - 04.07.2014

Well the number is just way beyond a 32 bit cell (cellmax = 2147483647)