Opened 8 years ago
Closed 8 years ago
#14322 closed enhancement (fixed)
improve documentation for Integer bits(); negative numbers have "negative bits"
Reported by: | ddrake | Owned by: | mvngu |
---|---|---|---|
Priority: | minor | Milestone: | sage-5.9 |
Component: | documentation | Keywords: | bits integers |
Cc: | Merged in: | sage-5.9.beta2 | |
Authors: | Dan Drake | Reviewers: | David Roe |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
On sage-devel I expressed my unease that negative integers have "negative bits". Strictly speaking, there is some inconsistency here, but the behavior is reasonable -- though it warrants some improved documentation.
Attached patch adds documentation for bits() to explain this.
Attachments (1)
Change History (6)
Changed 8 years ago by
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
- Status changed from new to needs_review
comment:3 follow-up: ↓ 4 Changed 8 years ago by
- Reviewers set to David Roe
- Status changed from needs_review to positive_review
Looks good. Adding similar documentation to digits
might be nice, but not necessary.
comment:4 in reply to: ↑ 3 Changed 8 years ago by
Replying to roed:
Looks good. Adding similar documentation to
digits
might be nice, but not necessary.
There's an example in the digits
documentation which shows the same kind of thing, so I thought I'd leave it for now.
Thanks for the quick review!
comment:5 Changed 8 years ago by
- Merged in set to sage-5.9.beta2
- Resolution set to fixed
- Status changed from positive_review to closed
One unrelated (ahem) bit: I added something to the documentation for
denominator
, which seems strange for integers -- so we might as well say that it just returns 1 for everything.