On Sun, Apr 13, 2008 at 9:03 AM, Harald Schilly
<[EMAIL PROTECTED]> wrote:
>
>  Hi
>
>  When entering integers beginning with zeros in Sage, they are
>  interpreted octal. I'm aware of #2863 which documents the behaviour of
>  Integer, but that's still somewhat inconsistent when parsing strings
>  and annoys me a bit.
>
>  sage: int('070')
>  70
>  sage: Integer('070')
>  56

Gees, that is very bad. I consider that a bug.  I've created a trac
ticket.

>  sage: 070
>  56
>  sage: 070.0
>  70.0000000000000
>

In Python we have

sage: float('070.0')
70.0


>  Personally, I would expect from a mathematical software to always
>  ignore leading zeros, perhaps except they begin with 0x which makes
>  them hexadecimal (that's currently the case). It could also be
>  dangerous when parsing ints in text-files into integers and suddenly
>  ending up with octal values...
>
>  harald

Unfortunately, half of the behavior above isn't defined by "a
mathematical software" but by the Python general purpose programming
language.  Sage has to be
changed to be consistent with Python, since the other option -- changing
Python -- is not an option.

-- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to