On 10/22/2014 4:27 AM, ast wrote:
HelloIf 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 Python is clever
You probably mean "CPython is clever". Other implementations may or may not have the same optimizations.
-- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list