Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#5782 closed defect (fixed)

[with patch, positive review] Failure of __pow__ in RDF for noninteger powers of zero

Reported by: kbaker Owned by: somebody
Priority: minor Milestone: sage-3.4.1
Component: basic arithmetic Keywords: RDF, __pow__, zero
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Positive noninteger powers of RDF(0) give nan rather than zero:

  sage: RDF(0)^.5
  nan

  sage: RDF(0)^(1/2)
  nan

In contrast, noninteger powers of CDF(0) have the correct value:

  sage: CDF(0)^.5
  0

  sage: CDF(0)^(1/2)
  0

Attachments (1)

5782-rdf-pow.patch (1.2 KB) - added by robertwb 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by robertwb

  • Summary changed from Failure of __pow__ in RDF for noninteger powers of zero to [with patch, needs review] Failure of __pow__ in RDF for noninteger powers of zero

comment:2 Changed 12 years ago by mabshoff

Hmm, we have some trivial doctest failures:

sage -t -long "devel/sage/sage/rings/real_double.pyx"       
**********************************************************************
File "/scratch/mabshoff/sage-3.4.1.rc3/devel/sage/sage/rings/real_double.pyx", line 1543:
    sage: RDF(0)^.5
Expected:
    0
Got:
    0.0
**********************************************************************
File "/scratch/mabshoff/sage-3.4.1.rc3/devel/sage/sage/rings/real_double.pyx", line 1545:
    sage: RDF(0)^(1/2)
Expected:
    0
Got:
    0.0
**********************************************************************

I think other than that this is good to go.

Cheers,

Michael

Changed 12 years ago by robertwb

comment:3 Changed 12 years ago by robertwb

Doh! Patch updated.

comment:4 Changed 12 years ago by mabshoff

  • Summary changed from [with patch, needs review] Failure of __pow__ in RDF for noninteger powers of zero to [with patch, positive review] Failure of __pow__ in RDF for noninteger powers of zero

Second patch looks good to me. Positive review. It also passes doctests :)

Cheers,

Michael

comment:5 Changed 12 years ago by mabshoff

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

Merged in Sage 3.4.1.rc3.

Cheers,

Michael

comment:6 follow-up: Changed 12 years ago by jason

Does this fix #5785?

comment:7 in reply to: ↑ 6 Changed 12 years ago by mabshoff

Replying to jason:

Does this fix #5785?

Yes.

Cheers,

Michael

Note: See TracTickets for help on using tickets.