when i input a parameter like Math.pow(2,4) to geth , it will change to 2^4=16 correctly.
token.batchTransfer([user2,user3],Math.pow(2,4),{from:user1})


but when i input a parameter like Math.pow(2,255) to geth , it will change to 0x800000000000016c889a28c160ce0422bb9138ff1d4e4827 wrongly insteaf of
0x8000000000000000000000000000000000000000000000
token.batchTransfer([user2,user3],Math.pow(2,255),{from:user1})


in addition, when i input a parameter 57896044618658097711785492504343953926634992332820282019728792003956564819968
(2 ^ 255) to geth , it will change to 0x800000000000016c889a28c160ce0422bb9138ff1d4e4827 wrongly insteaf of
0x8000000000000000000000000000000000000000000000


The console is a JavaScript console. JavaScrips uses float-s to represent numbers. The number you're trying to represent cannot be done via floats, it overflows and loses precision. You'll need to use a big number library that can work with arbitrary precision integers.
Thank you very much!
when i use the following way to represent numbers,then it works!
var value = web3.toBigNumber('578960446186580977117854925043439539266349923328202820197
28792003956564819968');
Most helpful comment
Thank you very much!
when i use the following way to represent numbers,then it works!