Opened 15 years ago

Closed 15 years ago

#2537 closed defect (invalid)

[with patch, needs review] a.frac() should return x-x.floor()

Reported by: Rishikesh Owned by: Rishikesh
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


frac(-2.9) should be .1

Attachments (1)

real.patch (4.2 KB) - added by Rishikesh 15 years ago.

Download all attachments as: .zip

Change History (3)

Changed 15 years ago by Rishikesh

Attachment: real.patch added

comment:1 Changed 15 years ago by Michael Abshoff

Summary: a.frac() should return x-x.floor()[with patch, needs review] a.frac() should return x-x.floor()

comment:2 Changed 15 years ago by Carl Witty

Milestone: sage-2.10.4sage-duplicate/invalid
Resolution: invalid
Status: newclosed

There is apparently no consensus on the meaning of frac() (see for some discussion of the issues and the different definitions). Since Sage's RR is mostly a wrapper for MPFR, I would prefer to stay with the current definition (which also matches my intuition for what "fractional part" should mean); this is also the definition used by the majority of a statistically meaningless sampling from a google search.

If you feel strongly about the issue, I suggest taking it to sage-devel to get a broader sampling of opinions on the question.

Note: See TracTickets for help on using tickets.