On Thu, Jul 30, 2009 at 3:10 AM, Steven
D'Aprano<ste...@remove.this.cybersource.com.au> wrote:
> On Wed, 29 Jul 2009 21:34:07 -0700, Chris Rebert wrote:
>
>> The difference is that it handles complex numbers, whereas the plain
>> "math" module doesn't.
>> I would guess the reason there are separate modules is for performance,
>> so as to avoid having to dispatch on type at runtime. But this is only a
>> guess.
>
> My understanding is that it is to avoid people who don't care about
> complex numbers being confused when math.sqrt(-1) returns 1j instead of
> raising an error.

That seems a better and more plausible rationale than my guess. Kudos.

- Chris
-- 
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to