Newbie question - Advanced math functions available under Windows?

The Toad the.toad at trashcanistan.ca
Sat Jul 3 01:17:48 CEST 2004


On Fri, 02 Jul 2004 18:59:13 -0400, Tim Heaney
<theaney at cablespeed.com> wrote:

>The Toad <the.toad at trashcanistan.ca> writes:
>>
>> The math module documentation says that these math functions are "thin
>> wrapers" around the platform C library funtions.  This seems to assume
>> a Unix/Linux system platform.
>>
>> Does this mean that math functions like sqrt(), etc. are not available
>> in Python when running on Windows based systems?   Thanks in advance.
>
>No, you just need to import the math module.
>
>  >>> import math
>  >>> math.sqrt(10)
>  3.1622776601683795
>
>If you want, you can import sqrt into your namespace
>
>  >>> from math import sqrt
>  >>> sqrt(10)
>  3.1622776601683795
>
>Often, you see people import everything from a module into their
>namespace with an asterisk
>
>  >>> from math import *
>  >>> sqrt(10)
>  3.1622776601683795
>
>I hope this helps,
>
>Tim


Thanks to Tim and Brian!  This helps a great deal.

DB



More information about the Python-list mailing list