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 GMP support to ForeignFunctions #2906

Merged
merged 4 commits into from
Aug 12, 2023

Conversation

d-torrance
Copy link
Member

This adds a new mpzT type to the ForeignFunctions package for working with GMP integers. For example:

i1 : needsPackage "ForeignFunctions"

o1 = ForeignFunctions

o1 : Package

i2 : mpzAdd = foreignFunction("__gmpz_add", void, {mpzT, mpzT, mpzT})

o2 = __gmpz_add

o2 : ForeignFunction

i3 : x = mpzT 0

o3 = 0

o3 : ForeignObject of type mpz_t

i4 : mpzAdd(x, 2, 3)

i5 : x

o5 = 5

o5 : ForeignObject of type mpz_t

i6 : value oo

o6 = 5

@DanGrayson DanGrayson merged commit 074b748 into Macaulay2:development Aug 12, 2023
6 checks passed
@d-torrance d-torrance deleted the ffi-gmp branch August 30, 2023 02:39
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.

2 participants