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

Divide operation problem #11

Open
gikosei opened this issue Oct 30, 2020 · 1 comment
Open

Divide operation problem #11

gikosei opened this issue Oct 30, 2020 · 1 comment

Comments

@gikosei
Copy link

gikosei commented Oct 30, 2020

Hi, I was using this library for my project, and found out that divide operation is not supported in this library.
I thought it doesn't make sense since Element_div method is clearly defined in pbc.c.
So I double checked the source code over and over, and found this.

pypbc/pypbc.c

Lines 1338 to 1341 in c518d6f

0,
0, //binaryfunc nb_floor_divide;
Element_div, //binaryfunc nb_true_divide;
0, //binaryfunc nb_inplace_floor_divide;

In here, the function position is shifted- so Element_div is actually pointing nb_inplace_floor_divide (ifloordiv), not nb_true_divide.
I think the 0 in line 1338 was supposed to be a blank space between nb_inside_or and nb_floor_divide.
After I erased the 0 in line 1338 and installed the library once again, the divide operation works.

Hope this helps if you were using this library and have to use divide operation.

@sInNerbai
Copy link

OHHHHHH,I really really want to give you a huge hug. This helps me a lot, i almost give up programming on python!

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

2 participants