.\" Copyright (c) 1985, 1991 Regents of the University of California. .\" 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. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" from: @(#)sqrt.3 6.4 (Berkeley) 5/6/91 .\" %Id: sqrt.3,v 1.5 1997/02/22 15:09:42 peter Exp % .\" .Dd May 6, 1991 .Dt SQRT 3 .Os .Sh 名称 .Nm cbrt , .Nm cbrtf , .Nm sqrt , .Nm sqrtf .Nd 立方根関数と平方根関数 .Sh 書式 .Fd #include .Ft double .Fn cbrt "double x" .Ft float .Fn cbrtf "float x" .Ft double .Fn sqrt "double x" .Ft float .Fn sqrtf "float x" .Sh 解説 .Fn cbrt 関数と .Fn cbrtf 関数は .Ar x の立方根を計算します。 .Pp .Fn sqrt 関数と .Fn sqrtf 関数は、 .Ar x の負でない平方根を計算します。 .Sh 戻り値 .Fn cbrt 関数と .Fn cbrtf 関数は、要求された立方根を返します。 .Fn sqrt 関数と .Fn sqrtf 関数は、エラーが発生した場合を除いて、要求された平方根を返します。 .Tn VAX または .Tn Tahoe プロセッサは、負の .Fa x の .Fn sqrt を取ろうとするとエラーが発生します。この場合、 グローバル変数 .Va errno が .Dv EDOM に設定され、予備のオペランド障害が生成されます。 .Sh エラー (切り捨てなどによるもの) .Fn cbrt 関数は、 0.7 .Em ulp まで正確です。 .Pp .Tn VAX 上の .Fn sqrt 関数は 0.501 .Em ulp 内まで正確です。 .Tn IEEE 754 に準拠するマシン上の .\" .Fn sqrt sqrt は、実施中の丸めモードに従って正確に丸められます。エラー は、デフォルトモード(四捨五入)で .Em ulp の半分未満です。 .Em ulp は、実行された 最後の場所の単位 ( .Em U Ns nit in the .Em L Ns ast .Em P Ns lace ) です。 .Sh 関連項目 .Xr math 3 .Pp .Sh 規格 .Nm sqrt 関数は .St -ansiC に準拠しています。 .Sh 歴史 .Fn cbrt 関数は .Bx 4.3 で現れました。