996d2f02f9
Submitted by: Yuko Sasaki <yuko@veltec.co.jp>
137 lines
3.6 KiB
Groff
137 lines
3.6 KiB
Groff
.\" 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: @(#)hypot.3 6.7 (Berkeley) 5/6/91
|
|
.\" %FreeBSD: src/lib/msun/man/hypot.3,v 1.5.2.3 2001/12/17 10:08:36 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd May 6, 1991
|
|
.Dt HYPOT 3
|
|
.Os BSD 4
|
|
.Sh ̾¾Î
|
|
.Nm hypot ,
|
|
.Nm hypotf ,
|
|
.Nm cabs ,
|
|
.Nm cabsf
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libm
|
|
.Nd ¥æ¡¼¥¯¥ê¥Ã¥Éµ÷Î¥¤ÈÊ£ÁÇÀäÂÐÃÍ´Ø¿ô
|
|
.Sh ½ñ¼°
|
|
.In math.h
|
|
.Ft double
|
|
.Fn hypot "double x" "double y"
|
|
.Ft float
|
|
.Fn hypotf "float x" "float y"
|
|
.Vt struct {double x, y;} z ;
|
|
.Ft double
|
|
.Fn cabs z
|
|
.Vt struct {float x, y;} z ;
|
|
.Ft float
|
|
.Fn cabsf z
|
|
.Sh ²òÀâ
|
|
.Fn hypot ,
|
|
.Fn hypotf ,
|
|
.Fn cabs ,
|
|
¤ª¤è¤Ó
|
|
.Fn cabsf
|
|
´Ø¿ô¤Ï¡¢¥¢¥ó¥À¥Õ¥í¡¼¤¬
|
|
µ¯¤¤º¡¢ºÇ½ª·ë²Ì¤Ç¥ª¡¼¥Ð¥Õ¥í¡¼¤¬µ¯¤³¤ë¾ì¹ç¤Î¤ß¥ª¡¼¥Ð¥Õ¥í¡¼¤¹¤ëÊýË¡¤Ç
|
|
sqrt(x*x+y*y)
|
|
¤ò·×»»¤·¤Þ¤¹¡£
|
|
.Pp
|
|
.Fn hypot "\*(If" "v"
|
|
¤¢¤ë¤¤¤Ï
|
|
.Fn hypot "v" "\*(If"
|
|
¤Ï¡¢Á´¤Æ¤Î
|
|
.Ar v
|
|
¤ËÂФ·¤Æ¡¢\*(Na ¤ò´Þ¤à +\*(If ¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.Sh ¸íº¹ ( Roundoff Åù¤Ë´ð¤Å¤¯ )
|
|
0.97
|
|
.Em ulps
|
|
°Ê²¼¡£
|
|
¤½¤Î·ë²Ì¡¢
|
|
´°Á´¤Ê
|
|
.Fn hypot "5.0" "12.0"
|
|
= 13.0
|
|
¤È¤Ê¤ë¡£Ä̾hypot ¤È cabs ¤ÏÀ°¿ôÃͤ¬µá¤á¤é¤ì¤ë»þ¤Ë¤Ïɬ¤ºÀ°¿ô¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Pp
|
|
cabs.c ¤ÎÃí¼á¤Ë¤¢¤ëû½Ì¡¢¤«¤Ä¹â®ÈǤΠhypot ¤È cabs ¤Ë¤Ä¤¤¤Æ¤ÏÎã³°¤È¤Ê¤ê¡¢
|
|
¸íº¹¤Ï 1.2
|
|
.Em ulps
|
|
¤òĶ¤¹¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
|
|
.Sh Ãí
|
|
ÁÛÄêÄ̤ꡢ
|
|
.Fn hypot "v" "\*(Na"
|
|
¤È
|
|
.Fn hypot "\*(Na" "v"
|
|
¤Ï
|
|
.Em Á´Í¸Â¿ô
|
|
.Ar v
|
|
¤ËÂФ·¤Æ
|
|
\*(Na
|
|
¤È¤Ê¤ê¤Þ¤¹¡£
|
|
"reserved operand" ¤¬ "\*(Na" ¤ËÃÖ¤´¹¤ï¤ì¤Ð¡¢
|
|
.Tn VAX
|
|
¤Ç¤âƱ¤¸·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.Tn VAX
|
|
°Ê³°¤Î¥Þ¥·¥ó ( ¤â¤·Ìµ¸Â¿ô¤¬Ìµ¤±¤ì¤Ð ) ¤Î¥×¥í¥°¥é¥Þ¤Ï
|
|
.Fn hypot "\(+-\*(If" "\*(Na"
|
|
= +\*(If
|
|
¤Ë½é¤á¤Ï¶Ã¤¯¤«¤â¤·¤ì¤Þ¤»¤ó¡£
|
|
¤³¤ì¤Ï°Õ¿ÞŪ¤Ê¤â¤Î¤Ç¤¢¤ê¡¢Ìµ¸Â¡¢Í¸Â¤Ë´Ø·¸¤Ê¤¯¡¢
|
|
.Em ¤¹¤Ù¤Æ¤Î
|
|
.Ar v
|
|
¤Ë¤Ä¤¤¤Æ
|
|
.Fn hypot "\*(If" "v"
|
|
= +\*(If
|
|
¤Ç¤¢¤ë¤¿¤á¤Ëµ¯¤³¤ê¤Þ¤¹¡£
|
|
¤·¤¿¤¬¤Ã¤Æ¡¢
|
|
.Fn hypot "\*(If" "v"
|
|
¤Ï¡¢
|
|
.Ar v
|
|
¤È¤ÏÆÈΩ¤·¤¿ÃͤǤ¹¡£
|
|
.Tn VAX
|
|
¤Ç¤ÎͽÌ󥪥ڥé¥ó¥É¥Õ¥©¥ë¥È¤È¤Ï°Û¤Ê¤ê¡¢
|
|
.Tn IEEE
|
|
\*(Na ¤Ï
|
|
.Fn hypot "\*(If" "\*(Na"
|
|
¤Ë¤ª¤¤¤ÆƱÍͤˡ¢Ìµ´Ø·¸¤Ë¤Ê¤ë¤È
|
|
¾Ã¼º¤·¤Þ¤¹¡£
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr math 3 ,
|
|
.Xr sqrt 3
|
|
.Sh Îò»Ë
|
|
.Fn hypot
|
|
´Ø¿ô¤È
|
|
.Fn cabs
|
|
´Ø¿ô¤Ï¤É¤Á¤é¤â
|
|
.At v7
|
|
¤«¤éÅо줷¤Þ¤·¤¿¡£
|