Date: Wed, 20 Feb 2002 19:50:01 -0800 (PST) From: Tim Robbins <tim@robbins.dropbear.id.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/35070: math(3) references section "3m", etc. Message-ID: <200202210350.g1L3o1E59014@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/35070; it has been noted by GNATS. From: Tim Robbins <tim@robbins.dropbear.id.au> To: Alexey Zelkin <phantom@FreeBSD.ORG> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/35070: math(3) references section "3m", etc. Date: Thu, 21 Feb 2002 14:33:17 +1100 On Wed, Feb 20, 2002 at 09:30:36PM +0200, Alexey Zelkin wrote: > On Sat, Feb 16, 2002 at 05:48:47PM +1100, Tim Robbins wrote: > > > > >Number: 35070 > > >Category: bin > > >Synopsis: math(3) references section "3m", etc. > > Clack! Trap is closed! > > PS: Do it! Here it is. IMO it contains more factual information about the actual math library than the current math(3) page does. If the discussions of VAX and IEEE floating point representations are useful, they should have their own separate manual pages - perhaps ieee754(7), vaxfp(7). I thought about doing a man->mdoc conversion of the IEEE 754 notes in the current math(3) page, but the writing style doesn't match that of the rest of the manual pages, and I don't know enough about the subject to know whether the information is correct. .\" Copyright (c) 2002 Tim J. Robbins .\" 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 February 21, 2002 .Dt MATH 3 .Os .Sh NAME .Nm math .Nd standard math library .Sh LIBRARY .Lb libm .Sh SYNOPSIS .In math.h .Sh DESCRIPTION The standard math library provides functions that perform common mathematical operations on floating point numbers. .Pp Most of the functions listed below take .Ft double arguments and return .Ft double values. Versions of these functions that work with .Ft float have an .Ql Va f suffix, for example .Fn sinf . .Pp In general, these functions return an undefined value if their arguments lie outside the correct domain and set .Sy errno to .Dv EDOM Ns No . If the correct result is too small or too large to represent, 0 or .Dv HUGE_VAL are return, respectively, and .Sy errno is set to .Dv ERANGE Ns No . .Sh FUNCTIONS Each function has its own manual page in section 3. For example, .Fn acos is thorougly described in .Xr acos 3 . .Pp .Ss Bessel Functions .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It j0, j1, jn Bessel functions of the first kind .It y0, y1, yn Bessel functions of the second kind .El .Ss Trigonometric Functions .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It acos Arc cosine .It asin Arc sine .It atan Arc tangent .It atan2 Arc tangent of two variables .It cos Cosine .It sin Sine .It tan Tangent .El .Ss Hyperbolic Trigonometric Functions .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It acosh Hyperbolic arc cosine .It asinh Hyperbolic arc sine .It atanh Hyperbolic arc tangent .It cosh Hyperbolic cosine .It sinh Hyperbolic sine .It tanh Hyperbolic tangent .El .Ss Exponentials and Logarithms .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It exp Exponential .It log Natural logarithm .It log10 Log base 10 .El .Ss IEEE Arithmetic and Tests .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It copysign Change sign of one number to match another .It finite Test for finite number .It ilogb Integer exponent .It logb Exponent .It nextafter Next representable number .It remainder Remainder function .It scalb Multiply by power of two .It scalbn Multiply by integer power of two .It significand Significand .El .Ss Tests .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It isinf Test for infinity .It isnan Test for not-a-number .El .Ss Powers and Roots .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It cbrt Cube root .It pow Power .It sqrt Square root .El .Ss `Splitting' Functions .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It frexp Break number into normalized fraction and integral power of 2 .It ldexp Multiply number by power of 2 .It modf Break number into integral and fractional parts .El .Ss Miscellaneous Functions .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It cabs Complex absolute value .It ceil Ceiling .It drem ? .It erf Error function calculation .It erfc Error function complement .It expm1 exp(x)-1 .It fabs Absolute value .It floor Floor .It fmod Remainder .It gamma Gamma .It gamma_r Reentrant gamma .It hypot Euclidean distance .It lgamma Log gamma .It lgamma_r Reentrant lgamma .It log1p log(1+x) .El .Sh CONSTANTS Commonly used mathematic constants, provided as preprocessor macros. .Pp .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It Dv M_E Euler's number (e) .It Dv M_LOG2E Log base 2 of e .It Dv M_LOG10E Log base 10 of e .It Dv M_LN2 Natural logarithm of 2 .It Dv M_LN10 Natural logarithm of 10 .It Dv M_PI pi .It Dv M_PI_2 pi/2 .It Dv M_PI_4 pi/4 .It Dv M_1_PI 1/pi .It Dv M_2_PI 2/pi .It Dv M_2_SQRTPI 2/sqrt(pi) .It Dv M_SQRT2 sqrt(2) .It Dv M_SQRT_1_2 1/sqrt(2) .El .Pp Other constants .Pp .Bl -tag -compact -width XXXXXXXXXX .It Sy Name .Sy Description .It Dv HUGE Obsolete name for .Dv MAXFLOAT .It Dv HUGE_VAL Indicates range error (discussed above) .It Dv MAXFLOAT Largest representable float .El .Sh SEE ALSO .Xr ieee 3 .Sh STANDARDS The .Os math library is a superset of .St -isoC . It is expected to conform to .St -p1003.1 and .St -xsh5 . To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202210350.g1L3o1E59014>