diff options
author | das <das@FreeBSD.org> | 2007-12-15 08:38:44 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2007-12-15 08:38:44 +0000 |
commit | 28907d1d2e97e0f72164343c49e4450f394fa70c (patch) | |
tree | 063bec4e9b1cd1d8633476c7fa825801bb31d3f7 /lib/msun/man | |
parent | 25e550cd1775af97dc9301e1982c4d18b93bac5a (diff) | |
download | FreeBSD-src-28907d1d2e97e0f72164343c49e4450f394fa70c.zip FreeBSD-src-28907d1d2e97e0f72164343c49e4450f394fa70c.tar.gz |
Implement and document csqrt(3) and csqrtf(3).
Diffstat (limited to 'lib/msun/man')
-rw-r--r-- | lib/msun/man/csqrt.3 | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/lib/msun/man/csqrt.3 b/lib/msun/man/csqrt.3 new file mode 100644 index 0000000..132b314 --- /dev/null +++ b/lib/msun/man/csqrt.3 @@ -0,0 +1,94 @@ +.\" Copyright (c) 2007 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$ +.\" +.Dd December 14, 2007 +.Dt CSQRT 3 +.Os +.Sh NAME +.Nm csqrt , +.Nm csqrtf +.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" +.Sh DESCRIPTION +The +.Fn csqrt +and +.Fn csqrtf +functions compute the square root of +.Fa z +in the complex plane, with a branch cut along the negative real axis. +In other words, +.Fn csqrt +and +.Fn csqrtf +always return the square root whose real part is non-negative. +.Sh RETURN VALUES +These 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 have +the same sign. +For infinities and \*(Nas, the following rules apply, with the +earlier rules having precedence: +.Bl -column -offset indent "-\*(If + \*(Na*I" "\*(If \*(Pm \*(If*I " "(for all k)" +.Em Input Result +k + \*(If*I \*(If + \*(If*I (for all k) +-\*(If + \*(Na*I \*(Na \*(Pm \*(If*I +\*(If + \*(Na*I \*(If + \*(Na*I +k + \*(Na*I \*(Na + \*(Na*I +\*(Na + k*I \*(Na + \*(Na*I +-\*(If + k*I +0 + \*(If*I +\*(If + k*I \*(If + 0*I +.El +.Pp +For numbers with negative imaginary parts, the above special cases +apply 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 and +an \*(Na is generated, an invalid exception will be thrown. +.Sh SEE ALSO +.Xr cabs 3 , +.Xr fenv 3 , +.Xr math 3 , +.Sh STANDARDS +The +.Fn csqrt +and +.Fn csqrtf +functions conform to +.St -isoC-99 . +.Sh BUGS +For +.Fn csqrt , +inexact results are not correctly rounded in general. |