Opened 11 months ago
Last modified 2 months ago
#28345 needs_work defect
Bug with NumberField.abs_val at zero
Reported by: | mercatp | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.2 |
Component: | number fields | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | u/mercatp/bug_with_numberfield_abs_val_at_zero (Commits) | Commit: | 9261c0ba965cb5c5dc8e5ab1090cb073d3da52b7 |
Dependencies: | Stopgaps: |
Description (last modified by )
The following code fail:
sage: K.<xi> = NumberField(x^3-3) sage: v_fin = tuple(K.primes_above(3))[0] sage: abs_val(K, v_fin, K(0))
It should return 0. See also ticket https://trac.sagemath.org/ticket/28241
The bug is corrected and a doctest has been added.
Change History (8)
comment:1 Changed 11 months ago by
- Summary changed from Bug with NumberField.abs_val to Bug with NumberField.abs_val at zero
comment:2 Changed 11 months ago by
- Branch set to u/mercatp/bug_with_numberfield_abs_val_at_zero
comment:3 Changed 11 months ago by
- Commit set to 9261c0ba965cb5c5dc8e5ab1090cb073d3da52b7
- Description modified (diff)
comment:4 Changed 10 months ago by
- Status changed from new to needs_review
I set this to needs review as it seems it is done, so the patchbots can check it.
The other way to do this would be to ensure that p^(-Infinity)
returns 0 in some way, but I don't suppose that really matters.
comment:5 Changed 7 months ago by
Returning 0
gives an int
which is of the wrong type, so please change it to return R.zero()
instead. Moreover, a blank line is needed after TESTS::
and please remove the trailing whitespace in the line above that. Also enter your full name in the authors field.
I am not too familiar with the theory, so it would be good if someone can confirm this is mathematically correct.
comment:6 Changed 7 months ago by
- Milestone changed from sage-8.9 to sage-9.0
- Status changed from needs_review to needs_work
comment:7 Changed 6 months ago by
- Milestone changed from sage-9.0 to sage-9.1
Ticket retargeted after milestone closed
comment:8 Changed 2 months ago by
- Milestone changed from sage-9.1 to sage-9.2
Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.
New commits:
Correct a bug with NumberField.abs_val and add a doctest to check that it's corected