In article ,
Ned Batchelder wrote:
>On 10/22/14 5:27 AM, ast wrote:
>>
>> "Chris Angelico" a écrit dans le message de
>> news:mailman.15058.1413968065.18130.python-l...@python.org...
>>> On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
>>>> If i
Ned Batchelder schrieb am 26.10.2014 um 21:45:
> On 10/26/14 4:07 PM, Tony the Tiger wrote:
>> On Wed, 22 Oct 2014 10:27:34 +0200, ast wrote:
>>
>>> If i am writing (-1)**1000 on a python program, will the interpreter do
>>> (-1)*(-1)*...*(-1) or something clever
On 10/26/14 4:07 PM, Tony the Tiger wrote:
On Wed, 22 Oct 2014 10:27:34 +0200, ast wrote:
If i am writing (-1)**1000 on a python program, will the interpreter do
(-1)*(-1)*...*(-1) or something clever ?
Even vs. odd. It ought to know. I would assume from a set of defined
rules how math works
Terry Reedy Wrote in message:
> On 10/22/2014 4:27 AM, ast wrote:
>> Hello
>>
>> If i am writing (-1)**1000 on a python program, will the
>> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> The answer depends on the implementation.
>
>>
On 10/22/2014 4:27 AM, ast wrote:
Hello
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
The answer depends on the implementation.
In fact i have (-1)**N with N an integer potentially big.
I do some tests that suggest that
On 10/22/14 5:27 AM, ast wrote:
"Chris Angelico" a écrit dans le message de
news:mailman.15058.1413968065.18130.python-l...@python.org...
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or
On Wed, Oct 22, 2014 at 4:43 AM, Tim Chase
wrote:
> On 2014-10-22 12:29, Peter Otten wrote:
>> That looks like log(a) while a parity check takes constant time:
>>
>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>> 1000 loops, best of 3: 0.124 usec per loop
>> $ python3 -m timeit -s 'a = 10**100
On Wed, Oct 22, 2014 at 5:02 AM, Peter Otten <__pete...@web.de> wrote:
> Michiel Overtoom wrote:
>
>>
>> On Oct 22, 2014, at 12:29, Peter Otten wrote:
>>
>>> That looks like log(a) while a parity check takes constant time:
>>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>>
>>
>> Do you mean 'parity
Michiel Overtoom wrote:
>
> On Oct 22, 2014, at 12:29, Peter Otten wrote:
>
>> That looks like log(a) while a parity check takes constant time:
>> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
>
>
> Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ?
> Because a parity bit deno
On 2014-10-22 12:29, Peter Otten wrote:
> That looks like log(a) while a parity check takes constant time:
>
> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
> 1000 loops, best of 3: 0.124 usec per loop
> $ python3 -m timeit -s 'a = 10**100' 'a & 1'
> 1000 loops, best of 3: 0.124 usec per loo
On Oct 22, 2014, at 12:29, Peter Otten wrote:
> That looks like log(a) while a parity check takes constant time:
> $ python3 -m timeit -s 'a = 10**10' 'a & 1'
Do you mean 'parity' as in http://en.wikipedia.org/wiki/Parity_bit ? Because a
parity bit denotes whether the *number* of '1' bits is
ast wrote:
>
> "Chris Angelico" a écrit dans le message de
> news:mailman.15058.1413968065.18130.python-l...@python.org...
>> On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
>>> If i am writing (-1)**1000 on a python program, will the
>>> interprete
"Chris Angelico" a écrit dans le message de
news:mailman.15058.1413968065.18130.python-l...@python.org...
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
In fact i have (-
ast wrote:
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> In fact i have (-1)**N with N an integer potentially big.
>
> I do some tests that suggest that Python is clever
Let's see:
$ python3
Pyt
On Wed, Oct 22, 2014 at 7:27 PM, ast wrote:
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or something clever ?
>
> In fact i have (-1)**N with N an integer potentially big.
Exponentiation is far more efficient than the naive imple
- Original Message -
> From: "ast"
> To: python-list@python.org
> Sent: Wednesday, 22 October, 2014 10:27:34 AM
> Subject: (-1)**1000
>
> Hello
>
> If i am writing (-1)**1000 on a python program, will the
> interpreter do (-1)*(-1)*...*(-1) or somet
Hello
If i am writing (-1)**1000 on a python program, will the
interpreter do (-1)*(-1)*...*(-1) or something clever ?
In fact i have (-1)**N with N an integer potentially big.
I do some tests that suggest that Python is clever
thx
--
https://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo