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

add long long to zz.h (draft) #29

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

Artoria2e5
Copy link

@Artoria2e5 Artoria2e5 commented Mar 10, 2024

This is my draft for fixing #28; it only handles NTL_BITS_PER_LONGLONG == NTL_BITS_PER_LONG for now. There are a couple of undone things and some questions from me:

  • For the computation of bpll, should I use a loop like the other types are using?
  • doc/conversions.txt is not yet updated
  • There is not yet an implementation for the case NTL_BITS_PER_LONGLONG == (2*NTL_BITS_PER_LONG). For this case, my idea is that we add some functions to lip.cpp that use NTL_ULL_TYPE and potentially a new signed NTL_LL_TYPE. Is that acceptable (or needed in the first place)?

Alright, I tried my hand at lip. It's not pretty.

@Artoria2e5 Artoria2e5 marked this pull request as draft March 12, 2024 05:55
inline unsigned long long to_ulonglong(const ZZ& a) { return (unsigned long long) _ntl_gtoudint(a.rep); }
inline void conv(ZZ& x, unsigned long long a) { _ntl_gudintoz(a, &x.rep); }
inline ZZ to_ZZ(unsigned long long a) { return ZZ(INIT_VAL, a); }
#endif
Copy link
Author

@Artoria2e5 Artoria2e5 Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to always offer _ntl_gtoudint using the NTL_ULL_TYPE too... right now vigna/CPRNG makes its own int128 routines. or is that too greedy?

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

Successfully merging this pull request may close these issues.

1 participant