| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 | .\" Copyright (c) 2007-2008 David Schultz <das@FreeBSD.org>.\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\".\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" $FreeBSD: src/lib/msun/man/csqrt.3,v 1.2 2008/03/30 20:07:15 das Exp $.\".Dd March 30, 2008.Dt CSQRT 3.Os.Sh NAME.Nm csqrt ,.Nm csqrtf ,.Nm csqrtl.Nd complex square root functions.Sh LIBRARY.Lb libm.Sh SYNOPSIS.In complex.h.Ft double complex.Fn csqrt "double complex z".Ft float complex.Fn csqrtf "float complex z".Ft long double complex.Fn csqrtl "long double complex z".Sh DESCRIPTIONThe.Fn csqrt ,.Fn csqrtf ,and.Fn csqrtlfunctions compute the square root of.Fa zin the complex plane, with a branch cut along the negative real axis.In other words,.Fn csqrt ,.Fn csqrtf ,and.Fn csqrtlalways return the square root whose real part is non-negative..Sh RETURN VALUESThese functions return the requested square root.The square root of 0 is.Li +0 \*(Pm 0 ,where the imaginary parts of the input and respective result havethe same sign.For infinities and \*(Nas, the following rules apply, with theearlier rules having precedence:.Bl -column -offset indent "-\*(If + \*(Na*I" "\*(If \*(Pm \*(If*I  " "(for all k)".Em Input	Resultk + \*(If*I	\*(If + \*(If*I	(for all k)-\*(If + \*(Na*I	\*(Na \*(Pm \*(If*I\*(If + \*(Na*I	\*(If + \*(Na*Ik + \*(Na*I	\*(Na + \*(Na*I\*(Na + k*I	\*(Na + \*(Na*I-\*(If + k*I	+0 + \*(If*I\*(If + k*I	\*(If + 0*I.El.PpFor numbers with negative imaginary parts, the above special casesapply given the identity:.Dl csqrt(conj(z) = conj(sqrt(z))Note that the sign of \*(Na is indeterminate.Also, if the real or imaginary part of the input is finite andan \*(Na is generated, an invalid exception will be thrown..Sh SEE ALSO.Xr cabs 3 ,.Xr fenv 3 ,.Xr math 3 ,.Sh STANDARDSThe.Fn csqrt ,.Fn csqrtf ,and.Fn csqrtlfunctions conform to.St -isoC-99 ..Sh BUGSFor.Fn csqrtand.Fn csqrtl ,inexact results are not always correctly rounded.
 |