Opened 12 years ago

Closed 12 years ago

#5199 closed defect (fixed)

[with patch, positive review] new symbolics can treat floats as integers inappropriately

Reported by: cwitty Owned by: burcin
Priority: major Milestone: sage-3.3
Component: calculus Keywords:
Cc: burcin Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Consider the following, in 3.3.alpha5:

sage: from sage.symbolic.ring import NSR
sage: NSR(10.0).gamma()
362880

We have produced an exact integral result of .gamma() on a floating-point number.

After #2898, this behavior makes doctests fail; but the above happens even before #2898.

I don't know if this is the "right" patch, but it does make all doctests pass after #2898.

Attachments (1)

pynac_is_integer.patch (2.0 KB) - added by cwitty 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by cwitty

comment:1 Changed 12 years ago by burcin

  • Summary changed from [with patch, needs review] new symbolics can treat floats as integers inappropriately to [with patch, positive review] new symbolics can treat floats as integers inappropriately

The patch looks good.

We might think about optimizing this function for speed later. Specialcasing Integer and Rational, and using the _parent attribute should help here.

comment:2 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 3.3.rc0.

Cheers,

Michael

Note: See TracTickets for help on using tickets.