Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Best search algorithm to find condition within a range Date: Wed, 08 Apr 2015 12:49:01 +1200 Lines: 20 Message-ID: References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net CBLSe/kSlX77Uqhh/cLu6w6tctEgdARHTQyvHHvLp4UV6u3Ey7 Cancel-Lock: sha1:Nace0WE7uudObyrQUETCXmcifMo= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: csiph.com comp.lang.python:88639 jonas.thornvall@gmail.com wrote: > No i don't i say the operations assume base ten other wise INT A=7,B=4 > Calculate C=A+B would not yield 11 as an answer. The answer, when converted to base 10, will still be 11 regardless of the base in which the arithmetic is performed. For example, in base 2: A = 0111 (decimal 7) B = 0100 (decimal 4) ---- C = 1011 Now convert binary 1011 to decimal and see what you get. -- Greg