Closed CowSmiles closed 2 years ago
"-9223372036854775807 - 1" is String
not Int
.
The numeric range of int in Rholang is [-9223372036854775808, 9223372036854775807] [-9223372036854775807, 9223372036854775807]
Well.I think you are right there is something wrong with parsing(saying normalizing in rholang is more correct).
The minimum of integer in rholang is -9223372036854775807
.
For number like -9223372036854775808
, rholang parser would parse this number by splitting it into -
and 9223372036854775808
. And the parser consider 9223372036854775808
is Long(Long in scala same like int64) while the maximum of integer is 9223372036854775807
which 9223372036854775808
can not convert to it. That's why the error occurs.
Thanks, I just thought is was a little confused. It's not a big deal.
What did you expect to see?
In Rholang, the integer is int64. So I thought the valid values of int is: [-2^63, 2^63-1],which is [-9223372036854775808, 9223372036854775807].
What did you see instead?
But in rholang code, when I ouput -9223372036854775808, it will report:
but -9223372036854775807 - 1 produce -9223372036854775808. So it is strange, maybe the problem occur at the parse of the input?
Steps to reproduce the bug
The following two snippets prove the question:
What version of RNode are you using?
v0.12.4
What is your environment?
VSCode Rholang plugin