Closed sunyaf closed 4 years ago
Hello @sunyaf thank you for the bug report.
Indeed I believe this is being caused by an integer overflow, since 33383002443812481 % 2^32 = 4063432321
I'll look into this and see if this limitation can be removed, otherwise I'll update the documentation to be explicit about this.
thank you,it would be soon to be happy. because i will use it as soon as possible. it would be very helpful to me. thank you very much.
Hello @sunyaf thank you for the bug report.
Indeed I believe this is being caused by an integer overflow, since
33383002443812481 % 2^32 = 4063432321
I'll look into this and see if this limitation can be removed, otherwise I'll update the documentation to be explicit about this. thank you,it would be soon to be happy. because i will use it as soon as possible. it would be very helpful to me. thank you very much.
Hello
I have confirmed that this issue is due to R.APPENDINTARRAY
using internally (1, 2) 32-bit integer arrays, which is the default implementation of the CRoaring build.
From a quick look on their repo it seems that it is possible to create a 64-bit version of the library for C++, but I didn't find anything for C specifically, which could put us in trouble.
In any case, I think this issue won't be very easy to fix. I'll probably just update the README for now to make it clearer that integers are capped at 32-bits.
I'll keep you updated.
Update: I have confirmed that CRoaring do not support 64-bit integers: https://github.com/RoaringBitmap/CRoaring/issues/232, https://github.com/RoaringBitmap/CRoaring/issues/1
We'll have to monitor their progress, so there isn't much we can do on this front for now. I'll update the README.
i find this
`
int main() { Roaring r1; for (uint32_t i = 100; i < 1000; i++) { r1.add(i); } std::cout << "cardinality = " << r1.cardinality() << std::endl;
Roaring64Map r2; for (uint64_t i = 18000000000000000100ull; i < 18000000000000001000ull; i++) { r2.add(i); } std::cout << "cardinality = " << r2.cardinality() << std::endl; return 0; } ` https://github.com/RoaringBitmap/CRoaring you can search 'Roaring64Map'
The C library is 32-bit only but there is a 64-bit extension in C++.
i find this `
include
include "roaring.hh"
include "roaring.c"
int main() { Roaring r1; for (uint32_t i = 100; i < 1000; i++) { r1.add(i); } std::cout << "cardinality = " << r1.cardinality() << std::endl;
Roaring64Map r2; for (uint64_t i = 18000000000000000100ull; i < 18000000000000001000ull; i++) { r2.add(i); } std::cout << "cardinality = " << r2.cardinality() << std::endl; return 0; } ` https://github.com/RoaringBitmap/CRoaring you can search 'Roaring64Map'
Requirements
I think C can code with C++
our user_id is very big , number type is bigint,like 33383002443812481 when i excutor
R.APPENDINTARRAY test 33383002443812481
i get isR.GETINTARRAY test
result is 4063432321