Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Unsigned 64-bit integer as Judy key

by swl (Parson)
on Dec 07, 2022 at 06:04 UTC ( #11148641=note: print w/replies, xml ) Need Help??

in reply to Unsigned 64-bit integer as Judy key

Do Judy arrays index from 1 instead of zero? Subtracting 1 from the key works without error.

perl -MJudy::L=Set -E 'Set($j, (1<<63)-1, 123); say $j' 94763462791888

And possibly not relevant, but I see these overflow warnings when compiling:

ib/Judy.xs:54:37: note: in definition of macro ‘OOGA’ 54 | PerlIO_printf(PerlIO_stdout(),__VA_ARGS__);\ | ^~~~~~~~~~~ lib/Judy.xs: In function ‘XS_Judy__HS_Delete’: lib/Judy.xs:46:26: warning: overflow in conversion from ‘long unsigned + int’ to ‘int’ changes value from ‘16045690984833335023’ to ‘-5590387 +37’ [-Woverflow] 46 | # define DEADBEEF 0xdeadbeefdeadbeef | ^~~~~~~~~~~~~~~~~~ lib/Judy.xs:46:26: note: in definition of macro ‘DEADBEEF’ 46 | # define DEADBEEF 0xdeadbeefdeadbeef | ^~~~~~~~~~~~~~~~~~

Perl version:

perl -v | grep This This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-li +nux

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148641]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2023-11-29 11:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found