News for hackers. Stuff that matters.
Re:How do you store numbers with leading zeros?\ by Cryptonic on Tuesday September 21, 2021 @02:33PM (#28608180)
Depends very much on what exactly you need. Up to 2^64-1 leading zeros followed by as high as you like (the RAM is the limit) positive value?

    struct NumberWithLeadingZeros {
        leading_zeros: u64,
        number: Vec<u64>
    }
Then implement some traits for it add, sub, pow, to_string etc. and work with it.

Or do something else that fits exactly your needs.

There are no comments on this comment yet.