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

Doctest: bug numerical_approx(2^(450232897/4888643760)) #24418

Closed
videlec opened this issue Dec 22, 2017 · 16 comments
Closed

Doctest: bug numerical_approx(2^(450232897/4888643760)) #24418

videlec opened this issue Dec 22, 2017 · 16 comments

Comments

@videlec
Copy link
Contributor

videlec commented Dec 22, 2017

sage: numerical_approx(2^(450232897/4888643760))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-3c4e30ac02c1> in <module>()
----> 1 numerical_approx(Integer(2)**(Integer(450232897)/Integer(4888643760)))

/opt/sage/local/lib/python2.7/site-packages/sage/misc/functional.pyc in numerical_approx(x, prec, digits, algorithm)
   1406         return numerical_approx_generic(x, prec)
   1407     else:
-> 1408         return n(prec, algorithm=algorithm)
   1409 
   1410 n = numerical_approx

/opt/sage/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.numerical_approx (build/cythonized/sage/symbolic/expression.cpp:36040)()
   5813 
   5814         s = DefiniteSumExpander(self)
-> 5815         cdef Expression x = self._parent(s())
   5816         from sage.rings.real_mpfr import RealField
   5817         R = RealField(prec)

/opt/sage/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in __call__(self, ex)
    216                 div = self.get_fake_div(ex)
    217                 return self.arithmetic(div, div.operato
--> 218             return self.arithmetic(ex, operator)
    219         elif operator in relation_operators:
    220             return self.relation(ex, operator)

/opt/sage/local/lib/python2.7/site-packages/sage/symbolic/expretic(self, ex, operator)
   1931             True
   1932         """
-> 1933         return reduce(operator, map(self, ex.operands()
   1934 
   1935     def composition(self, ex, operator):

/opt/sage/src/sage/symbolic/expression.pyx in sage.symbolic.expd/cythonized/sage/symbolic/expression.cpp:26528)()
   3962                                relational_operator(base
   3963             else:
-> 3964                 x = g_pow(base._gobj, nexp._gobj)
   3965             return new_Expression_from_GEx(base._parent
   3966         if BOTH_ARE_ELEMENT(cl):

RuntimeError: 

The following works

sage: 2^(450232897/4888643760)
2^(450232897/4888643760)
sage: 2.0^(450232897/4888643760)
1.06591892580915

Original report on sage-devel.

CC: @rwst

Component: symbolics

Keywords: bug

Author: Ralf Stephan

Branch/Commit: 821f7d9

Reviewer: Jeroen Demeyer

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

@videlec videlec added this to the sage-8.2 milestone Dec 22, 2017
@videlec

This comment has been minimized.

@rwst
Copy link

rwst commented Dec 22, 2017

comment:2

Wrong usage of MPZ size query functions in Pynac. Fixed in 0.7.15. If you cannot wait apply this patch: https://github.com/pynac/pynac/commit/163a26940a1a07aaea12ff82532a6c3ea4162c91.diff,

@rwst
Copy link

rwst commented Dec 22, 2017

Upstream: Fixed upstream, in a later stable release.

@rwst
Copy link

rwst commented Jan 29, 2018

@rwst
Copy link

rwst commented Jan 29, 2018

New commits:

4d559ee24418: Doctest

@rwst
Copy link

rwst commented Jan 29, 2018

Commit: 4d559ee

@rwst
Copy link

rwst commented Jan 29, 2018

Changed upstream from Fixed upstream, in a later stable release. to none

@rwst
Copy link

rwst commented Jan 29, 2018

Author: Ralf Stephan

@rwst rwst changed the title bug numerical_approx(2^(450232897/4888643760)) Doctest: bug numerical_approx(2^(450232897/4888643760)) Jan 29, 2018
@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2018

Changed commit from 4d559ee to a2a47a8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2018

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

a2a47a824418: fixes

@rwst
Copy link

rwst commented Jan 29, 2018

comment:9

Ah that was a typo which I couldn't cancel fast enough, sorry.

@rwst
Copy link

rwst commented Jan 29, 2018

@rwst
Copy link

rwst commented Jan 29, 2018

Changed commit from a2a47a8 to 821f7d9

@rwst
Copy link

rwst commented Jan 29, 2018

New commits:

821f7d924418: Doctest

@vbraun
Copy link
Member

vbraun commented Feb 1, 2018

Changed branch from u/rws/24418-1 to 821f7d9

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

4 participants