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

Coercion of axiom Float to python float #264

Closed
sagetrac-gvanuxem mannequin opened this issue Feb 15, 2007 · 2 comments
Closed

Coercion of axiom Float to python float #264

sagetrac-gvanuxem mannequin opened this issue Feb 15, 2007 · 2 comments

Comments

@sagetrac-gvanuxem
Copy link
Mannequin

sagetrac-gvanuxem mannequin commented Feb 15, 2007

Here is the output of this type of coercion:

sage: float axiom(1.7)
----> float(axiom(RealNumber('1.7')))
---------------------------------------------------------------------------
<type 'exceptions.ValueError'>            Traceback (most recent call last)

/home/greg/<ipython console> in <module>()

/usr/local/sage/local/lib/python2.5/site-packages/sage/interfaces/axiom.py in __float__(self)
    422 
    423     def __float__(self):
--> 424         return float(str(self.numer()))
    425 
    426     def __len__(self):

<type 'exceptions.ValueError'>: invalid literal for float(): float(250875719402449901978,-67,2)

The problem is that the Axiom Float is coerced to InputForm and in this format (actually) the internal representation of this Float is obtained : 250875719402449901978*2**-67.

Component: interfaces

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

@williamstein

This comment has been minimized.

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.9.1 milestone Sep 6, 2007
@williamstein
Copy link
Contributor

comment:3

This works fine in sage-2.8.8.

@williamstein williamstein modified the milestones: sage-2.9.1, sage-2.8.8 Oct 21, 2007
tobiasdiez pushed a commit to tobiasdiez/sage that referenced this issue Feb 22, 2024
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

1 participant