Hi,
For university I experimented with libtommath in C and wondered if and
how Hare supports big integers.
There doesn't seem to be a official way of working with big numbers in
the standard library.
Greetings
Simon
On Sun Jun 4, 2023 at 2:11 PM EDT, Simon wrote:
> Hi,>>> For university I experimented with libtommath in C and wondered if and > how Hare supports big integers.>> There doesn't seem to be a official way of working with big numbers in > the standard library.
bignum support is planned, but currently unimplemented.
"Sebastian" <sebastian@sebsite.pw> wrote:
> On Sun Jun 4, 2023 at 2:11 PM EDT, Simon wrote:> > Hi,> >> >> > For university I experimented with libtommath in C and wondered if and > > how Hare supports big integers.> >> > There doesn't seem to be a official way of working with big numbers in > > the standard library.> > bignum support is planned, but currently unimplemented.
What about crypto::bigint?
https://git.sr.ht/~sircmpwn/hare/tree/master/item/crypto/bigint
I wanted to play with arbitrary precision arithmetic too and thought
this was the way to go (but I have not had time to work on it yet).
On 6/5/23 11:22, Sebastiano Tronto wrote:
>> bignum support is planned, but currently unimplemented.> > What about crypto::bigint?> > https://git.sr.ht/~sircmpwn/hare/tree/master/item/crypto/bigint> > I wanted to play with arbitrary precision arithmetic too and thought> this was the way to go (but I have not had time to work on it yet).
crypto::bigint is very narrow in scope and hard to use, since it's made
to work without dynamic allocations. It's also not very performant
because of its constant time requirements.
yyp has started working on an general purpose bigint implementation,
though the project is still unlisted. Dunno if it's ok to share the
link. Maybe you can ping yyp on irc about it. Also autumnull! has done
something in this direction afaik.
I was working on a library that supports basic arbitrary precision:
https://git.sr.ht/~yerinalexey/hare-bigint
Unlike crypto::bigint, it automatically expands numbers on overflow,
but it has weak test coverage, uses too much memory and doesn't support
proper in-place operations (a = big::add(a, b) works, but it will create
a memory leak). I'll be working to resolve those issues in the near
future.
Hi,
> I was working on a library that supports basic arbitrary precision:
> https://git.sr.ht/~yerinalexey/hare-bigint
This looks pretty cool and I will look into it. Thanks!