A pretty dumb newbie question
Duncan Smith
buzzard at urubu.freeserve.co.uk
Mon Dec 10 10:59:19 EST 2001
More information about the Python-list mailing list
Mon Dec 10 10:59:19 EST 2001
- Previous message (by thread): A pretty dumb newbie question
- Next message (by thread): A pretty dumb newbie question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"davewesterman" <dave2206 at aol.com> wrote in message news:20011210091906.16346.00001379 at mb-ma.aol.com... > sqrt(x) > Return the square root of x. > > >How would you calculate square root? I've tried > >x**1/2 > >Which doesn't work > >Anbody? > How about, >>> x**(1/2.0) 2.8284271247461903 What you have will raise x to the power 1, then divide the result by 2. Also, note the float in the denominator. 1/2 will return the floor (the result rounded down to the nearest integer), ie 0, and x**0 is 1. > > *)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*)(*()*) > (*()*)(*()*)(*()*)(*()*)(*()*)(*()*)
- Previous message (by thread): A pretty dumb newbie question
- Next message (by thread): A pretty dumb newbie question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list