Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure of __pow__ in RDF for noninteger powers of zero #5782

Closed
sagetrac-kbaker mannequin opened this issue Apr 14, 2009 · 7 comments
Closed

Failure of __pow__ in RDF for noninteger powers of zero #5782

sagetrac-kbaker mannequin opened this issue Apr 14, 2009 · 7 comments

Comments

@sagetrac-kbaker
Copy link
Mannequin

sagetrac-kbaker mannequin commented Apr 14, 2009

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

Component: basic arithmetic

Keywords: RDF, pow, zero

Issue created by migration from https://trac.sagemath.org/ticket/5782

@sagetrac-kbaker sagetrac-kbaker mannequin added this to the sage-3.4.1 milestone Apr 14, 2009
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 16, 2009

comment:2

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

@robertwb
Copy link
Contributor

Attachment: 5782-rdf-pow.patch.gz

@robertwb
Copy link
Contributor

comment:3

Doh! Patch updated.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 16, 2009

comment:4

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

Cheers,

Michael

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 16, 2009

comment:5

Merged in Sage 3.4.1.rc3.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Apr 16, 2009
@jasongrout
Copy link
Member

comment:6

Does this fix #5785?

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 16, 2009

comment:7

Replying to @jasongrout:

Does this fix #5785?

Yes.

Cheers,

Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants