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:

Status badges

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)

bits-doc.patch (1.6 KB) - added by ddrake 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by ddrake

comment:1 Changed 8 years ago by ddrake

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.

comment:2 Changed 8 years ago by ddrake

  • Status changed from new to needs_review

comment:3 follow-up: Changed 8 years ago by roed

  • 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 ddrake

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 jdemeyer

  • Merged in set to sage-5.9.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.