Ticket #5587 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

input of hexadecimal integers is corrupted

Reported by: zimmerma Owned by: somebody
Priority: major Milestone: sage-4.1.1
Component: basic arithmetic Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

sage: 0xabcdf
703711
sage: 0xabcdef
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/zimmerma/.sage/temp/toto.loria.fr/11913/_home_zimmerma__sage_init_sage_0.py in <module>()

/usr/local/sage-3.4/sage/local/lib/python2.5/site-packages/sage/rings/real_mpfr.so in sage.rings.real_mpfr.create_RealNumber (sage/rings/real_mpfr.c:22110)()

/usr/local/sage-3.4/sage/local/lib/python2.5/site-packages/sage/rings/real_mpfr.so in sage.rings.real_mpfr.RealLiteral.__init__ (sage/rings/real_mpfr.c:21326)()

/usr/local/sage-3.4/sage/local/lib/python2.5/site-packages/sage/rings/real_mpfr.so in sage.rings.real_mpfr.RealNumber.__init__ (sage/rings/real_mpfr.c:7473)()

/usr/local/sage-3.4/sage/local/lib/python2.5/site-packages/sage/rings/real_mpfr.so in sage.rings.real_mpfr.RealNumber._set (sage/rings/real_mpfr.c:7976)()

TypeError: Unable to convert x (='0xabcdef') to real number.

I understand that Sage tries to recognize a floating-point number due to the 'e', but then how to input a hexadecimal integer?

Change History

comment:1 Changed 4 years ago by mvngu

  • Status changed from new to closed
  • Resolution set to fixed

Looks like this is fixed in Sage 4.1:

----------------------------------------------------------------------
| Sage Version 4.1, Release Date: 2009-07-09                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: 0xabcdf
703711
sage: 0xabcdef
11259375

I'm closing this ticket as fixed.

Note: See TracTickets for help on using tickets.