Python complaints

Ivan Van Laningham ivanlan at callware.com
Thu Dec 16 10:00:51 EST 1999


Hi All--

Charles Boncelet wrote:
> 

[bobbitt]

> What kind of number is allowed?  Can x be an integer, a float, complex,
> long, hex?  There is no way to know, without doing the experiment.
> BTW, experimentation indicates that it fails if x is complex and works
> for the others. sin seems to be promoting its argument to a float and
> taking the sine.  However, sin(complex) is a perfectly good mathematical
> operation.  It should work.
> 

Use
	import cmath

and
	s=cmath.sin(c) 

All of the standard math functions that live in math.py have
correspondent functions in cmath.py.

Metta,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan at callware.com
ivanlan at home.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
Author:  Teach Yourself Python in 24 Hours
----------------------------------------------




More information about the Python-list mailing list