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: int(070)
56
sage: Integer('070')
56
sage: Integer(070)
56
sage: 070
56
sage: 070.0
70.0000000000000

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

--~--~---------~--~----~------------~-------~--~----~
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