XRPL-Labs / xrpld-hooks

ISC License
94 stars 28 forks source link

Use sort-safe XFL representations #49

Closed Mwni closed 1 year ago

Mwni commented 2 years ago

I propose a minor change in the binary representation in order to make XFLs sortable by their casted 64 bit integer value:

bit 62 now is: 0 = negative, 1 = positive bit 61 - 53: if the XFL is negative, XOR with 0xFFFF bit 53 - 0: if the XFL is negative, negate, then XOR with 0x3FFFFFFFFFFFFF

More about this in the standard's draft: https://github.com/XRPLF/XRPL-Standards/discussions/39#discussioncomment-2991180

RichardAH commented 1 year ago

https://github.com/XRPLF/XRPL-Standards/discussions/39#discussioncomment-4726999