Skip to content

master (v.1.1.0) vs develop (3/12/2020) #479

@mdehoogh

Description

@mdehoogh

I'm using libtommath to some extent in an interpreter I'm writing, and because the current develop branch was not giving me the error on mp_set_double compilation that master (v.1.1.0) branch was giving me, I was intent on switching over to using develop instead. However, some of the functions I was using have turned into defines (mp_incr, mp_decr, mp_isodd, mp_sqr); mp_n_root was renamed (I guess) to mp_root_n and mp_toradix to mp_to_radix; MP_YES and MP_NO were removed. Using the develop tommath.h was much worse than an adaptation of the old tommath.h, so I switched to using the latter. One problem I encountered was that the type of the size parameter in mp_radix_size changed from int to size_t, causing serious problems when passing in a local int (overwriting a pointer). For now I've added a compiler flag to check whether to use size_t or int but it is a nuisance to have to put that in a C source file:

#ifdef M_MP_DEVELOP
size_t arepsize=0; // MDH@13MAR2020: changing type int to size_t (which is larger), so that we should be able to use it with libtommath-develop
#else
int arepsize=0;
#endif

Furthermore, when I use the develop version my factorial algorithm is say 15% slower with develop than with master. Any idea why?

Kind regards,
Marc P. de Hoogh
The Netherlands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions