[Ethereum] Solidity Browser Compiler — Error: Assertion failed

remix

Here's the code:

contract C {
    function a(uint x){}
}

I try to call C.a(1000000000000000000);

and get an error:

Error encoding arguments: Error: Assertion failed

while C.a(100000000); is perfectly fine

What's the problem there?

Best Answer

The uint is too big for a native Javascript Number, so the Solidity Browser needs the input in quotes ("1000000000000000000") so that it can read the input as a string and manipulate it as a BigNumber.

Thanks for asking and I added it to How to quickly test a Solidity function?

For easy testing, I tested with this code:

contract C {
    function a(uint x) returns(uint) { return x; }
}