Opened 7 years ago

Closed 7 years ago

#13634 closed defect (fixed)

Fix to output of scientific notation for real interval field

Reported by: tscrim Owned by: tscrim
Priority: major Milestone: sage-5.5
Component: misc Keywords: real interval field
Cc: Merged in: sage-5.5.beta1
Authors: Travis Scrimshaw Reviewers: Robert Bradshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by tscrim)

Currently if you set scientific notation for the real interval field, it does not print in scientific notation.

sage: RIF.scientific_notation(True)
sage: RIF(0.025)
0.025000000000000002?
sage: RIF.scientific_notation()
True
sage: RIF(0.025)
0.025000000000000002?
sage: RIF(0.025).str(no_sci=False)
'2.5000000000000002?e-2'

This is caused by not checking when no_sci option is None (and then checking the parent). After patch:

sage: RIF(0.025)
0.025000000000000002?
sage: RIF.scientific_notation(True)
sage: RIF(0.025)
2.5000000000000002?e-2

Attachments (1)

trac_13634-RIF_sci_notation_fix-ts.patch (7.8 KB) - added by tscrim 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by tscrim

  • Status changed from new to needs_review

Please review.

comment:2 Changed 7 years ago by tscrim

  • Description modified (diff)

comment:3 Changed 7 years ago by robertwb

Minor nit: I'd prefere "not no_sci" to "no_sci == False" in case the user passes a value like 0. But other than that, looks good (including the nice docstring cleanups).

comment:4 Changed 7 years ago by robertwb

  • Reviewers set to Robert Bradshaw

Changed 7 years ago by tscrim

comment:5 Changed 7 years ago by tscrim

Changed. Thank you.

comment:6 Changed 7 years ago by robertwb

  • Status changed from needs_review to positive_review

comment:7 Changed 7 years ago by jdemeyer

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