[erlang-questions] changes in native functions for the next otp release.
Angel
clist@REDACTED
Thu Jan 21 15:41:22 CET 2010
On Jueves, 21 de Enero de 2010 14:12:42 Sverker Eriksson escribió:
> Angel wrote:
> > Hi
> >
> > Some months ago, i discovered that square root of bignums is not
> > implemented in erlang. So i developed a tiny C port program to do this
> > math stuff.
> >
> > Now im considering making a NIF implementation....
> >
> > i dont know if
> >
> > int enif_get_int(ErlNifEnv* env, ERL_NIF_TERM term, int* ip)
> >
> > will allow me to manipulate bignums or i have to resort on binaries.
>
> No, enif_get_int will only give you integers within the bounds of the
> C-type "int".
> I guess you have to resort to binaries.
>
> > ¿is erl_nif subject for big changes for the next release? any changes for
> > bignums?
>
> There will be changes and additions but I don't think bignums will make
> it to next release. The main problem is to choose a good bignum
> representation to use and support for ever.
>
>
> /Sverker, Erlang/OTP Ericsson
>
>
Does erlang convert between internal format to gmp formats over and over when
processing bignums, or the structure for erlang bignums are not binary
compatible with gmp?
maybe you could do just a memcpy over existing bignum to erl_nif space? This
would allow direct manipulaton on the C side with gmp.
i saw the sources and dont seem very gmpishh...
/angel
More information about the erlang-questions
mailing list