-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
As currently implemented, arb.neg() returns a copy of the original arb, rather than its negation. You can see this pretty clearly:
from flint import arb
arb(1, 2) in arb(1, 2) # Returns true, as it should.
arb(1, 2).neg() in arb(1, 2) # Returns true, but should return false.
arb(1, 2).neg() in arb(-1, 2) # Returns false, should return true.
arb(1, 2).neg().mid() # Returns 1, should return -1
It looks like this is a pretty simple typo: here neg() calls arb_set() or arb_set_round() rather than arb_neg() or arb_neg_round(). __neg__() is implemented correctly, so if you replace arb(...).neg() with -arb(...) in the above, it will work.
Metadata
Metadata
Assignees
Labels
No labels