Jump to content
  • 0

Warning script:op_2num


Feefty

Question

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

2147483647 is the maximum value for script numbers because they are declared as 32-bit signed integers.

The error means your script tried to do some math that resulted in a value larger than 2147483647.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  175
  • Reputation:   14
  • Joined:  11/21/11
  • Last Seen:  

2147483647 is the maximum value for script numbers because they are declared as 32-bit signed integers.

The error means your script tried to do some math that resulted in a value larger than 2147483647.

oh okay thanks.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

switch( op )

{// operators that can overflow/underflow

case C_ADD: ret = i1 + i2; ret_double = (double)i1 + (double)i2; break;

case C_SUB: ret = i1 - i2; ret_double = (double)i1 - (double)i2; break;

case C_MUL: ret = i1 * i2; ret_double = (double)i1 * (double)i2; break;

default:

......................................................

else if( ret_double > (double)INT_MAX )

{

ShowWarning("script:op_2num: overflow detected op=%s i1=%d i2=%d\n", script_op2name(op), i1, i2);

script_reportsrc(st);

ret = INT_MAX;

}

[Warning]: script:op2num: overflow detected op=C_MUL i1=1355146399 i2=1000

means in that script you performed a MULTIPLY of 1355146399 and 1000, causing overflow

try think of something that you can has a variable of 1355146399 times 1000 something like that

EDIT: eh ... already solved, I always post slow

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  175
  • Reputation:   14
  • Joined:  11/21/11
  • Last Seen:  

switch( op )

{// operators that can overflow/underflow

case C_ADD: ret = i1 + i2; ret_double = (double)i1 + (double)i2; break;

case C_SUB: ret = i1 - i2; ret_double = (double)i1 - (double)i2; break;

case C_MUL: ret = i1 * i2; ret_double = (double)i1 * (double)i2; break;

default:

......................................................

else if( ret_double > (double)INT_MAX )

{

ShowWarning("script:op_2num: overflow detected op=%s i1=%d i2=%d\n", script_op2name(op), i1, i2);

script_reportsrc(st);

ret = INT_MAX;

}

[Warning]: script:op2num: overflow detected op=C_MUL i1=1355146399 i2=1000

means in that script you performed a MULTIPLY of 1355146399 and 1000, causing overflow

try think of something that you can has a variable of 1355146399 times 1000 something like that

EDIT: eh ... already solved, I always post slow

yeah :D im still learning athena scripting, i just read about OnHour

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...