FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix arb.neg() by Maegereg · Pull Request #336 · flintlib/python-flint · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .py  (1) .pyx  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Contributors (0.9.0):
- Rémy Oudompheng (RO)
- Agriya Khetarpal (AK)
- Oscar Benjamin (OB)
- Daniel Simmons-Marengo (DSM)

Changes (0.9.0):

Expand All @@ -181,6 +182,9 @@ Changes (0.9.0):
- [gh-312](https://github.com/flintlib/python-flint/pull/312),
Add `discriminant` method to `fmpz_poly`, `fmpq_poly` and
`nmod_poly`. (RO)
- [gh-336](https://github.com/flintlib/python-flint/pull/336),
Fixed a bug in `arb.neg()` which caused it to return its input
without negating it. (DSM)

0.8.0
-----
Expand Down
2 changes: 2 additions & 0 deletions src/flint/test/test_all.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,8 @@ def test_arb():
assert arb(3) <= arb("inf")
assert arb(3) == arb(3)
assert arb(3) != arb(2)
assert -arb(3) == arb(-3)
assert arb(3).neg() == arb(-3)
assert not (arb("1.1") == arb("1.1"))

assert arb(3).repr() == 'arb((0x3, 0x0))'
Expand Down
4 changes: 2 additions & 2 deletions src/flint/types/arb.pyx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ cdef class arb(flint_scalar):
def neg(self, bint exact=False):
res = arb.__new__(arb)
if exact:
arb_set((<arb>res).val, (<arb>self).val)
arb_neg((<arb>res).val, (<arb>self).val)
else:
arb_set_round((<arb>res).val, (<arb>self).val, getprec())
arb_neg_round((<arb>res).val, (<arb>self).val, getprec())
return res

def __abs__(self):
Expand Down
Loading

Back | FazBrowse Home | New Git URL