A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005722.html below:

[Patches] [Patch #100752] Make atoi work for negative bases, a useful generalization

[Python-Dev] Re: [Patches] [Patch #100752] Make atoi work for negative bases, a useful generalizationAlexander D Wissner-Gross alexwg@MIT.EDU
Fri, 7 Jul 2000 09:31:52 -0400 (EDT)
Skip,

Built-in support for negative bases would encourage further use of Python
in math research (specifically, representation theory). For reference,
Mathematica recently added support for negative base conversions.

Negative bases allow the unique representation of both positive and
negative integers without use of a sign. For example, "-3" in decimal 
equals, in base -2, "1101" (-3 = 1*(-2)^3 + 1*(-2)^2 + 0*(-2)^1 + 1*(-2)^0).
It has been suggested that this property makes negative bases a more natural
representation for integers than positive bases. There is more detailed 
information on the subject in The Art of Computer Programming Vol. 2.

This functionality is not already in Python, as someone suggested on
patches@python.org.

Alex





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4