Opened 13 years ago

Closed 13 years ago

#7556 closed enhancement (fixed)

change default rounding behavior for QQ to 'away'

Reported by: was Owned by: AlexGhitza
Priority: major Milestone: sage-4.3
Component: basic arithmetic Keywords:
Cc: Merged in: sage-4.3.alpha1
Authors: William Stein Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This is inconsistent:

sage: (9/2).round()
4
sage: RDF('4.5').round()
5
sage: import __builtin__
sage: __builtin__.round(float('4.5'))
5.0
sage: RR('4.5').round()
5

It's also inconsistent for negatives. The simple fix is to make the default rounding direction 'away' in rational.pyx.

Attachments (1)

trac_7556.patch (1.6 KB) - added by was 13 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 13 years ago by was

  • Status changed from new to needs_review
  • Summary changed from change default rounding behavior for QQ to to change default rounding behavior for QQ to 'away'

Changed 13 years ago by was

comment:2 Changed 13 years ago by mhansen

  • Authors set to William Stein
  • Reviewers set to Mike Hansen
  • Status changed from needs_review to positive_review

Looks good to me.

comment:3 Changed 13 years ago by mhansen

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