Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mdehoogh opened this issue Mar 13, 2020 · 4 comments
Closed

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

mdehoogh opened this issue Mar 13, 2020 · 4 comments

Comments

@mdehoogh
Copy link

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

@czurnieden
Copy link
Contributor

[…]the error on mp_set_double compilation that master (v.1.1.0) branch was giving[…]

What error do you get?
There is a problem with MacOS, see #159 for the details. The actual commit to fix it is in #476

Please be aware that the current version in master is 1.2.0. I don't know if the fix from #476 gets backported in the near future, we are currently a bit understaffed and overworked here, so it might take a little more time to get 1.2.1 out.

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

15% is quite significant!
What algorithm? Naive, binary splitting, Borwein, Borwein-Schönberg?
Do you have the implementation public?
(I apologize in advance if you have it in your github repository and I was too blind to find it)

@mdehoogh
Copy link
Author

mdehoogh commented Mar 13, 2020 via email

@mdehoogh
Copy link
Author

mdehoogh commented Mar 13, 2020 via email

@sjaeckel
Copy link
Member

I'm closing this as there was no action for too long.
Please re-open if you have further questions/comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants