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

comparison bug between real balls and real literals #24410

Closed
videlec opened this issue Dec 20, 2017 · 3 comments
Closed

comparison bug between real balls and real literals #24410

videlec opened this issue Dec 20, 2017 · 3 comments

Comments

@videlec
Copy link
Contributor

videlec commented Dec 20, 2017

sage: RBF(0) < -1.0
True

CC: @mezzarobba @jdemeyer @cheuberg

Component: basic arithmetic

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

@videlec videlec added this to the sage-8.2 milestone Dec 20, 2017
@mezzarobba
Copy link
Member

comment:1

Isn't it just an instance of #22029? Even if they are a bit special, real litterals are elements of RR...

@videlec
Copy link
Contributor Author

videlec commented Dec 21, 2017

comment:2

Replying to @mezzarobba:

Isn't it just an instance of #22029? Even if they are a bit special, real litterals are elements of RR...

From the ticket description of #22029 it is hard to tell. But I believe that the answer is yes.

@jdemeyer
Copy link

comment:3

This is because of

sage: coercion_model.canonical_coercion(RBF(0), -1.0)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-bf5b7fb19950> in <module>()
----> 1 coercion_model.canonical_coercion(RBF(Integer(0)), -RealNumber('1.0'))

/usr/local/src/sage-config/src/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion (build/cythonized/sage/structure/coerce.c:12993)()
   1133         raise bin_op_exception(op, x, y)
   1134 
-> 1135     cpdef canonical_coercion(self, x, y):
   1136         r"""
   1137         Given two elements x and y, with parents S and R respectively,

/usr/local/src/sage-config/src/sage/structure/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion (build/cythonized/sage/structure/coerce.c:12888)()
   1276                 self._record_exception()
   1277 
-> 1278         raise TypeError("no common canonical parent for objects with parents: '%s' and '%s'"%(xp, yp))
   1279 
   1280 

TypeError: no common canonical parent for objects with parents: 'Real ball field with 53 bits of precision' and 'Real Field with 53 bits of precision'

So it's indeed sort-of a duplicate of #22029.

@jdemeyer jdemeyer removed this from the sage-8.2 milestone Dec 21, 2017
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

3 participants