Ticket #3757 (closed enhancement: fixed)

Opened 5 months ago

Last modified 5 months ago

[with patch, positive review] change printing for intervals (and AA/QQbar)

Reported by: cwitty Assigned to: somebody
Priority: major Milestone: sage-3.1
Component: basic arithmetic Keywords:
Cc:

Description

This patch introduces "question-mark style printing" for intervals, where instead of [1.123 .. 1.125] we get 1.124? (the question mark means that the previous digit may be off by +/- 1). (The slightly unfortunate thing is that [1.1238 .. 1.1242] will also print as 1.124?, so the new default printing loses a lot of information about exactly how tight the interval is.)

I'm going to post a preliminary patch first, that actually changes the printing and adds extensive docstrings and doctests for the new/changed methods. This leaves many, many doctests broken throughout the rest of Sage.

If/when this preliminary patch is positively reviewed, I will go ahead and post a follow-on patch that fixes all the doctests.

Attachments

trac3757-question-printing-part1.patch (29.6 kB) - added by cwitty on 08/02/2008 07:34:57 AM.
trac3757-question-printing-part2.patch (139.1 kB) - added by cwitty on 08/02/2008 01:35:24 PM.

Change History

08/02/2008 07:34:57 AM changed by cwitty

  • attachment trac3757-question-printing-part1.patch added.

08/02/2008 09:19:57 AM changed by jason

Looks good to me! Positive review for part1.patch

08/02/2008 01:35:24 PM changed by cwitty

  • attachment trac3757-question-printing-part2.patch added.

08/02/2008 01:37:04 PM changed by cwitty

  • summary changed from [with preliminary patch, needs review] change printing for intervals (and AA/QQbar) to [with patch, needs review] change printing for intervals (and AA/QQbar).

OK, I've added the rest of the patch; after applying both patches, testall passes (on 32-bit and 64-bit x86 Debian testing).

08/03/2008 11:24:53 AM changed by was

  • summary changed from [with patch, needs review] change printing for intervals (and AA/QQbar) to [with patch, positive review] change printing for intervals (and AA/QQbar).

REVIEW:

I just read through both patches. Wow, these are models of how to write good quality code that is very very well documented!!

Also, I very much appreciate the added discussion of the "error digits" in the second patch.

This passes all tests for me on OS X. Thus positive review for the whole thing.

08/05/2008 04:53:00 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.1.alpha1