Announcement

Collapse
No announcement yet.

Math.Random return -2147483648

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Imagine Programming
    replied
    Originally posted by mslight13 View Post
    Thanks Again For Your Reply...
    I suggest use all of the LUA functions and modules in next version of AMS (in Action Wizard) or put a description in AMS help file.
    Indigorose is not responsible for documenting Lua functions. Lua is a standalone scripting engine which is used in AMS, you can read up on all the Lua 5.1 functions in the Lua 5.1 reference manual.

    Leave a comment:


  • mslight13
    replied
    Originally posted by Ulrich View Post
    Please refer to the Lua 5.1 Reference Manual for details on standard Lua functions defined in the language.

    Ulrich
    Thanks Again For Your Reply...
    I suggest use all of the LUA functions and modules in next version of AMS (in Action Wizard) or put a description in AMS help file.

    Leave a comment:


  • Ulrich
    replied
    Please refer to the Lua 5.1 Reference Manual for details on standard Lua functions defined in the language.

    Ulrich

    Leave a comment:


  • mslight13
    replied
    Originally posted by Ulrich View Post
    Unless you use external libraries, you may see this happening, as the big number causes an overflow. However, you could easily write your own random number generator, if you really need big numbers, for example:
    Code:
    function Math.BigRandom()
    	local nRand1 = Math.Random(0, 99999);
    	local nRand2 = Math.Random(0, 99999);
    	return string.format("%05d%05d", nRand1, nRand2);
    end
    Ulrich
    Thanks Ulrich,
    Can you give me more information about string.format? I can't find it in Action Wizard...

    Leave a comment:


  • Ulrich
    replied
    Unless you use external libraries, you may see this happening, as the big number causes an overflow. However, you could easily write your own random number generator, if you really need big numbers, for example:
    Code:
    function Math.BigRandom()
    	local nRand1 = Math.Random(0, 99999);
    	local nRand2 = Math.Random(0, 99999);
    	return string.format("%05d%05d", nRand1, nRand2);
    end
    Ulrich

    Leave a comment:


  • mslight13
    started a topic Math.Random return -2147483648

    Math.Random return -2147483648

    Hi all,
    I'm trying to use 'Math.Random' action to generate 10 digit random number but it returned -2147483648.

    I think the digits of generated number in 'Math.Random' action is limited.
    Is there anyone to help me for solving this problem?
Working...
X