Ticket #3910 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

[with patch, with positive review] adjust interval printing: precise integers print as integers

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

Description

This patch adjusts interval printing so that sufficiently small precise integers print as integers. (It also fixes a loss-of-precision bug when one endpoint is tiny and the other endpoint is zero.)

Before:

sage: RIF(0)
0.?e-17
sage: RIF(1)
1.0000000000000000?
sage: RIF(0, 2^-256)
1.?e-17

After:

sage: RIF(0)
0
sage: RIF(1)
1
sage: RIF(0, 2^-256)
1.?e-77

Attachments

trac3910-interval-integers.patch (24.1 kB) - added by cwitty on 08/20/2008 07:23:57 AM.

Change History

08/20/2008 07:23:57 AM changed by cwitty

  • attachment trac3910-interval-integers.patch added.

08/23/2008 01:47:21 PM changed by cremona

  • summary changed from [with patch, needs review] adjust interval printing: precise integers print as integers to [with patch, with positive review] adjust interval printing: precise integers print as integers.

The design decision behind this was well aired on sage-devel and I seem to remember the consensus was for this change.

The patch (a lot of which consists in changing the doctest outputs) looks fine, applies cleanly to 3.1.1 and passes all doctests in sage/rings and sage/calculus. I did not check the docs.

I recommend that this passes.

08/24/2008 06:43:02 PM changed by mabshoff

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

Merged in Sage 3.1.2.alpha1. All doctests pass with the patch applied.

Cheers,

Michael