Opened 13 years ago

Closed 12 years ago

#264 closed defect (fixed)

Coercion of axiom Float to python float

Reported by: gvanuxem Owned by: was
Priority: major Milestone: sage-2.8.8
Component: interfaces Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by was)

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.

Change History (3)

comment:1 Changed 13 years ago by was

  • Description modified (diff)

comment:2 Changed 12 years ago by mabshoff

  • Milestone set to sage-2.9.1

comment:3 Changed 12 years ago by was

  • Milestone changed from sage-2.9.1 to sage-2.8.8
  • Resolution set to fixed
  • Status changed from new to closed

This works fine in sage-2.8.8.

Note: See TracTickets for help on using tickets.