math.h revision 1.61 1 1.61 matt /* $NetBSD: math.h,v 1.61 2013/02/11 07:29:21 matt Exp $ */
2 1.10 cgd
3 1.1 cgd /*
4 1.6 jtc * ====================================================
5 1.6 jtc * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 1.1 cgd *
7 1.6 jtc * Developed at SunPro, a Sun Microsystems, Inc. business.
8 1.6 jtc * Permission to use, copy, modify, and distribute this
9 1.38 junyoung * software is freely granted, provided that this notice
10 1.6 jtc * is preserved.
11 1.6 jtc * ====================================================
12 1.1 cgd */
13 1.1 cgd
14 1.6 jtc /*
15 1.10 cgd * @(#)fdlibm.h 5.1 93/09/24
16 1.6 jtc */
17 1.1 cgd
18 1.6 jtc #ifndef _MATH_H_
19 1.7 cgd #define _MATH_H_
20 1.1 cgd
21 1.21 kleink #include <sys/cdefs.h>
22 1.12 kleink #include <sys/featuretest.h>
23 1.24 simonb
24 1.24 simonb union __float_u {
25 1.24 simonb unsigned char __dummy[sizeof(float)];
26 1.24 simonb float __val;
27 1.24 simonb };
28 1.24 simonb
29 1.24 simonb union __double_u {
30 1.24 simonb unsigned char __dummy[sizeof(double)];
31 1.24 simonb double __val;
32 1.24 simonb };
33 1.24 simonb
34 1.26 thorpej union __long_double_u {
35 1.26 thorpej unsigned char __dummy[sizeof(long double)];
36 1.26 thorpej long double __val;
37 1.26 thorpej };
38 1.26 thorpej
39 1.26 thorpej #include <machine/math.h> /* may use __float_u, __double_u,
40 1.26 thorpej or __long_double_u */
41 1.60 matt #include <limits.h> /* for INT_{MIN,MAX} */
42 1.12 kleink
43 1.29 kleink #ifdef __HAVE_LONG_DOUBLE
44 1.29 kleink #define __fpmacro_unary_floating(__name, __arg0) \
45 1.33 kleink /* LINTED */ \
46 1.29 kleink ((sizeof (__arg0) == sizeof (float)) \
47 1.29 kleink ? __ ## __name ## f (__arg0) \
48 1.29 kleink : (sizeof (__arg0) == sizeof (double)) \
49 1.29 kleink ? __ ## __name ## d (__arg0) \
50 1.29 kleink : __ ## __name ## l (__arg0))
51 1.29 kleink #else
52 1.29 kleink #define __fpmacro_unary_floating(__name, __arg0) \
53 1.33 kleink /* LINTED */ \
54 1.29 kleink ((sizeof (__arg0) == sizeof (float)) \
55 1.29 kleink ? __ ## __name ## f (__arg0) \
56 1.29 kleink : __ ## __name ## d (__arg0))
57 1.30 uwe #endif /* __HAVE_LONG_DOUBLE */
58 1.29 kleink
59 1.1 cgd /*
60 1.6 jtc * ANSI/POSIX
61 1.6 jtc */
62 1.28 kleink /* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
63 1.51 joerg #if __GNUC_PREREQ__(3, 3)
64 1.51 joerg #define HUGE_VAL __builtin_huge_val()
65 1.51 joerg #else
66 1.42 perry extern const union __double_u __infinity;
67 1.24 simonb #define HUGE_VAL __infinity.__val
68 1.51 joerg #endif
69 1.24 simonb
70 1.24 simonb /*
71 1.24 simonb * ISO C99
72 1.24 simonb */
73 1.27 kleink #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
74 1.27 kleink !defined(_XOPEN_SOURCE) || \
75 1.27 kleink ((__STDC_VERSION__ - 0) >= 199901L) || \
76 1.27 kleink ((_POSIX_C_SOURCE - 0) >= 200112L) || \
77 1.27 kleink ((_XOPEN_SOURCE - 0) >= 600) || \
78 1.27 kleink defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
79 1.28 kleink /* 7.12#3 HUGE_VAL, HUGELF, HUGE_VALL */
80 1.51 joerg #if __GNUC_PREREQ__(3, 3)
81 1.51 joerg #define HUGE_VALF __builtin_huge_valf()
82 1.51 joerg #define HUGE_VALL __builtin_huge_vall()
83 1.51 joerg #else
84 1.42 perry extern const union __float_u __infinityf;
85 1.27 kleink #define HUGE_VALF __infinityf.__val
86 1.27 kleink
87 1.42 perry extern const union __long_double_u __infinityl;
88 1.27 kleink #define HUGE_VALL __infinityl.__val
89 1.51 joerg #endif
90 1.27 kleink
91 1.28 kleink /* 7.12#4 INFINITY */
92 1.57 matt #if defined(__INFINITY)
93 1.57 matt #define INFINITY __INFINITY /* float constant which overflows */
94 1.57 matt #elif __GNUC_PREREQ__(3, 3)
95 1.51 joerg #define INFINITY __builtin_inff()
96 1.28 kleink #else
97 1.28 kleink #define INFINITY HUGE_VALF /* positive infinity */
98 1.28 kleink #endif /* __INFINITY */
99 1.28 kleink
100 1.28 kleink /* 7.12#5 NAN: a quiet NaN, if supported */
101 1.27 kleink #ifdef __HAVE_NANF
102 1.48 martin #if __GNUC_PREREQ__(3,3)
103 1.48 martin #define NAN __builtin_nanf("")
104 1.48 martin #else
105 1.42 perry extern const union __float_u __nanf;
106 1.24 simonb #define NAN __nanf.__val
107 1.48 martin #endif
108 1.27 kleink #endif /* __HAVE_NANF */
109 1.29 kleink
110 1.29 kleink /* 7.12#6 number classification macros */
111 1.29 kleink #define FP_INFINITE 0x00
112 1.29 kleink #define FP_NAN 0x01
113 1.29 kleink #define FP_NORMAL 0x02
114 1.29 kleink #define FP_SUBNORMAL 0x03
115 1.29 kleink #define FP_ZERO 0x04
116 1.29 kleink /* NetBSD extensions */
117 1.29 kleink #define _FP_LOMD 0x80 /* range for machine-specific classes */
118 1.29 kleink #define _FP_HIMD 0xff
119 1.29 kleink
120 1.60 matt #define FP_ILOGB0 INT_MIN
121 1.61 matt #define FP_ILOGBNAN INT_MAX
122 1.60 matt
123 1.27 kleink #endif /* !_ANSI_SOURCE && ... */
124 1.1 cgd
125 1.6 jtc /*
126 1.6 jtc * XOPEN/SVID
127 1.6 jtc */
128 1.25 bjh21 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
129 1.1 cgd #define M_E 2.7182818284590452354 /* e */
130 1.1 cgd #define M_LOG2E 1.4426950408889634074 /* log 2e */
131 1.1 cgd #define M_LOG10E 0.43429448190325182765 /* log 10e */
132 1.1 cgd #define M_LN2 0.69314718055994530942 /* log e2 */
133 1.1 cgd #define M_LN10 2.30258509299404568402 /* log e10 */
134 1.1 cgd #define M_PI 3.14159265358979323846 /* pi */
135 1.1 cgd #define M_PI_2 1.57079632679489661923 /* pi/2 */
136 1.1 cgd #define M_PI_4 0.78539816339744830962 /* pi/4 */
137 1.1 cgd #define M_1_PI 0.31830988618379067154 /* 1/pi */
138 1.1 cgd #define M_2_PI 0.63661977236758134308 /* 2/pi */
139 1.1 cgd #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
140 1.1 cgd #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
141 1.1 cgd #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
142 1.6 jtc
143 1.6 jtc #define MAXFLOAT ((float)3.40282346638528860e+38)
144 1.6 jtc extern int signgam;
145 1.25 bjh21 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
146 1.6 jtc
147 1.25 bjh21 #if defined(_NETBSD_SOURCE)
148 1.6 jtc enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
149 1.6 jtc
150 1.6 jtc #define _LIB_VERSION_TYPE enum fdversion
151 1.38 junyoung #define _LIB_VERSION _fdlib_version
152 1.6 jtc
153 1.38 junyoung /* if global variable _LIB_VERSION is not desirable, one may
154 1.38 junyoung * change the following to be a constant by:
155 1.6 jtc * #define _LIB_VERSION_TYPE const enum version
156 1.6 jtc * In that case, after one initializes the value _LIB_VERSION (see
157 1.6 jtc * s_lib_version.c) during compile time, it cannot be modified
158 1.6 jtc * in the middle of a program
159 1.38 junyoung */
160 1.6 jtc extern _LIB_VERSION_TYPE _LIB_VERSION;
161 1.6 jtc
162 1.6 jtc #define _IEEE_ fdlibm_ieee
163 1.6 jtc #define _SVID_ fdlibm_svid
164 1.6 jtc #define _XOPEN_ fdlibm_xopen
165 1.6 jtc #define _POSIX_ fdlibm_posix
166 1.6 jtc
167 1.11 tv #ifndef __cplusplus
168 1.6 jtc struct exception {
169 1.6 jtc int type;
170 1.47 christos const char *name;
171 1.6 jtc double arg1;
172 1.6 jtc double arg2;
173 1.6 jtc double retval;
174 1.6 jtc };
175 1.11 tv #endif
176 1.6 jtc
177 1.6 jtc #define HUGE MAXFLOAT
178 1.6 jtc
179 1.38 junyoung /*
180 1.6 jtc * set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
181 1.6 jtc * (one may replace the following line by "#include <values.h>")
182 1.6 jtc */
183 1.6 jtc
184 1.38 junyoung #define X_TLOSS 1.41484755040568800000e+16
185 1.6 jtc
186 1.6 jtc #define DOMAIN 1
187 1.6 jtc #define SING 2
188 1.6 jtc #define OVERFLOW 3
189 1.6 jtc #define UNDERFLOW 4
190 1.6 jtc #define TLOSS 5
191 1.6 jtc #define PLOSS 6
192 1.6 jtc
193 1.25 bjh21 #endif /* _NETBSD_SOURCE */
194 1.6 jtc
195 1.1 cgd __BEGIN_DECLS
196 1.6 jtc /*
197 1.6 jtc * ANSI/POSIX
198 1.6 jtc */
199 1.40 perry double acos(double);
200 1.40 perry double asin(double);
201 1.40 perry double atan(double);
202 1.40 perry double atan2(double, double);
203 1.40 perry double cos(double);
204 1.40 perry double sin(double);
205 1.40 perry double tan(double);
206 1.40 perry
207 1.40 perry double cosh(double);
208 1.40 perry double sinh(double);
209 1.40 perry double tanh(double);
210 1.40 perry
211 1.40 perry double exp(double);
212 1.50 christos double exp2(double);
213 1.40 perry double frexp(double, int *);
214 1.40 perry double ldexp(double, int);
215 1.40 perry double log(double);
216 1.41 christos double log2(double);
217 1.40 perry double log10(double);
218 1.40 perry double modf(double, double *);
219 1.40 perry
220 1.40 perry double pow(double, double);
221 1.40 perry double sqrt(double);
222 1.40 perry
223 1.40 perry double ceil(double);
224 1.40 perry double fabs(double);
225 1.40 perry double floor(double);
226 1.40 perry double fmod(double, double);
227 1.1 cgd
228 1.25 bjh21 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
229 1.40 perry double erf(double);
230 1.40 perry double erfc(double);
231 1.40 perry double gamma(double);
232 1.40 perry double hypot(double, double);
233 1.40 perry int finite(double);
234 1.40 perry double j0(double);
235 1.40 perry double j1(double);
236 1.40 perry double jn(int, double);
237 1.40 perry double lgamma(double);
238 1.40 perry double y0(double);
239 1.40 perry double y1(double);
240 1.40 perry double yn(int, double);
241 1.6 jtc
242 1.25 bjh21 #if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
243 1.40 perry double acosh(double);
244 1.40 perry double asinh(double);
245 1.40 perry double atanh(double);
246 1.40 perry double cbrt(double);
247 1.40 perry double expm1(double);
248 1.40 perry int ilogb(double);
249 1.40 perry double log1p(double);
250 1.40 perry double logb(double);
251 1.40 perry double nextafter(double, double);
252 1.40 perry double remainder(double, double);
253 1.40 perry double rint(double);
254 1.40 perry double scalb(double, double);
255 1.25 bjh21 #endif /* (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)*/
256 1.25 bjh21 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
257 1.6 jtc
258 1.29 kleink /*
259 1.29 kleink * ISO C99
260 1.29 kleink */
261 1.29 kleink #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
262 1.29 kleink !defined(_XOPEN_SOURCE) || \
263 1.29 kleink ((__STDC_VERSION__ - 0) >= 199901L) || \
264 1.29 kleink ((_POSIX_C_SOURCE - 0) >= 200112L) || \
265 1.29 kleink ((_XOPEN_SOURCE - 0) >= 600) || \
266 1.29 kleink defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
267 1.29 kleink /* 7.12.3.1 int fpclassify(real-floating x) */
268 1.29 kleink #define fpclassify(__x) __fpmacro_unary_floating(fpclassify, __x)
269 1.29 kleink
270 1.29 kleink /* 7.12.3.2 int isfinite(real-floating x) */
271 1.29 kleink #define isfinite(__x) __fpmacro_unary_floating(isfinite, __x)
272 1.29 kleink
273 1.29 kleink /* 7.12.3.5 int isnormal(real-floating x) */
274 1.29 kleink #define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
275 1.29 kleink
276 1.29 kleink /* 7.12.3.6 int signbit(real-floating x) */
277 1.29 kleink #define signbit(__x) __fpmacro_unary_floating(signbit, __x)
278 1.29 kleink
279 1.35 drochner /* 7.12.4 trigonometric */
280 1.35 drochner
281 1.40 perry float acosf(float);
282 1.40 perry float asinf(float);
283 1.40 perry float atanf(float);
284 1.40 perry float atan2f(float, float);
285 1.40 perry float cosf(float);
286 1.40 perry float sinf(float);
287 1.40 perry float tanf(float);
288 1.35 drochner
289 1.59 matt long double acosl(long double);
290 1.59 matt long double asinl(long double);
291 1.59 matt long double atanl(long double);
292 1.59 matt long double atan2l(long double, long double);
293 1.59 matt long double cosl(long double);
294 1.59 matt long double sinl(long double);
295 1.59 matt long double tanl(long double);
296 1.59 matt
297 1.35 drochner /* 7.12.5 hyperbolic */
298 1.35 drochner
299 1.40 perry float acoshf(float);
300 1.40 perry float asinhf(float);
301 1.40 perry float atanhf(float);
302 1.40 perry float coshf(float);
303 1.40 perry float sinhf(float);
304 1.40 perry float tanhf(float);
305 1.59 matt long double acoshl(long double);
306 1.59 matt long double asinhl(long double);
307 1.59 matt long double atanhl(long double);
308 1.59 matt long double coshl(long double);
309 1.59 matt long double sinhl(long double);
310 1.59 matt long double tanhl(long double);
311 1.35 drochner
312 1.35 drochner /* 7.12.6 exp / log */
313 1.35 drochner
314 1.40 perry float expf(float);
315 1.50 christos float exp2f(float);
316 1.40 perry float expm1f(float);
317 1.40 perry float frexpf(float, int *);
318 1.40 perry int ilogbf(float);
319 1.40 perry float ldexpf(float, int);
320 1.40 perry float logf(float);
321 1.41 christos float log2f(float);
322 1.40 perry float log10f(float);
323 1.40 perry float log1pf(float);
324 1.40 perry float logbf(float);
325 1.40 perry float modff(float, float *);
326 1.40 perry float scalbnf(float, int);
327 1.59 matt float scalblnf(float, long);
328 1.59 matt
329 1.59 matt long double expl(long double);
330 1.59 matt long double exp2l(long double);
331 1.59 matt long double expm1l(long double);
332 1.59 matt long double frexpl(long double, int *);
333 1.59 matt int ilogbl(long double);
334 1.59 matt long double ldexpl(long double, int);
335 1.59 matt long double logl(long double);
336 1.59 matt long double log2l(long double);
337 1.59 matt long double log10l(long double);
338 1.59 matt long double log1pl(long double);
339 1.59 matt long double logbl(long double);
340 1.59 matt long double modfl(long double, long double *);
341 1.59 matt long double scalbnl(long double, int);
342 1.59 matt long double scalblnl(long double, long);
343 1.59 matt
344 1.35 drochner
345 1.35 drochner /* 7.12.7 power / absolute */
346 1.35 drochner
347 1.40 perry float cbrtf(float);
348 1.40 perry float fabsf(float);
349 1.40 perry float hypotf(float, float);
350 1.40 perry float powf(float, float);
351 1.40 perry float sqrtf(float);
352 1.59 matt long double cbrtl(long double);
353 1.59 matt long double fabsl(long double);
354 1.59 matt long double hypotl(long double, long double);
355 1.59 matt long double powl(long double, long double);
356 1.59 matt long double sqrtl(long double);
357 1.35 drochner
358 1.35 drochner /* 7.12.8 error / gamma */
359 1.35 drochner
360 1.59 matt double tgamma(double);
361 1.40 perry float erff(float);
362 1.40 perry float erfcf(float);
363 1.40 perry float lgammaf(float);
364 1.58 christos float tgammaf(float);
365 1.59 matt long double erfl(long double);
366 1.59 matt long double erfcl(long double);
367 1.59 matt long double lgammal(long double);
368 1.59 matt long double tgammal(long double);
369 1.35 drochner
370 1.35 drochner /* 7.12.9 nearest integer */
371 1.35 drochner
372 1.59 matt /* LONGLONG */
373 1.59 matt long long int llrint(double);
374 1.59 matt long int lround(double);
375 1.59 matt /* LONGLONG */
376 1.59 matt long long int llround(double);
377 1.59 matt long int lrint(double);
378 1.59 matt double round(double);
379 1.59 matt double trunc(double);
380 1.59 matt
381 1.40 perry float ceilf(float);
382 1.40 perry float floorf(float);
383 1.59 matt /* LONGLONG */
384 1.59 matt long long int llrintf(float);
385 1.59 matt long int lroundf(float);
386 1.59 matt /* LONGLONG */
387 1.59 matt long long int llroundf(float);
388 1.59 matt long int lrintf(float);
389 1.40 perry float rintf(float);
390 1.40 perry float roundf(float);
391 1.44 xtraeme float truncf(float);
392 1.59 matt long double ceill(long double);
393 1.59 matt long double floorl(long double);
394 1.36 drochner /* LONGLONG */
395 1.59 matt long long int llrintl(long double);
396 1.59 matt long int lroundl(long double);
397 1.37 drochner /* LONGLONG */
398 1.59 matt long long int llroundl(long double);
399 1.59 matt long int lrintl(long double);
400 1.59 matt long double rintl(long double);
401 1.59 matt long double roundl(long double);
402 1.59 matt long double truncl(long double);
403 1.35 drochner
404 1.35 drochner /* 7.12.10 remainder */
405 1.35 drochner
406 1.40 perry float fmodf(float, float);
407 1.40 perry float remainderf(float, float);
408 1.59 matt long double fmodl(long double, long double);
409 1.59 matt long double remainderl(long double, long double);
410 1.35 drochner
411 1.54 christos /* 7.12.10.3 The remquo functions */
412 1.54 christos double remquo(double, double, int *);
413 1.54 christos float remquof(float, float, int *);
414 1.59 matt long double remquol(long double, long double, int *);
415 1.54 christos
416 1.45 drochner /* 7.12.11 manipulation */
417 1.35 drochner
418 1.59 matt double nan(const char *);
419 1.59 matt double nearbyint(double);
420 1.59 matt double nexttoward(double, long double);
421 1.40 perry float copysignf(float, float);
422 1.59 matt float nanf(const char *);
423 1.59 matt float nearbyintf(float);
424 1.59 matt float nextafterf(float, float);
425 1.59 matt float nexttowardf(float, long double);
426 1.53 christos long double copysignl(long double, long double);
427 1.43 kleink long double nanl(const char *);
428 1.59 matt long double nearbyintl(long double);
429 1.53 christos long double nextafterl(long double, long double);
430 1.59 matt long double nexttowardl(long double, long double);
431 1.35 drochner
432 1.52 dholland /* 7.12.14 comparison */
433 1.45 drochner
434 1.45 drochner #define isunordered(x, y) (isnan(x) || isnan(y))
435 1.45 drochner #define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y))
436 1.45 drochner #define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y))
437 1.45 drochner #define isless(x, y) (!isunordered((x), (y)) && (x) < (y))
438 1.45 drochner #define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y))
439 1.45 drochner #define islessgreater(x, y) (!isunordered((x), (y)) && \
440 1.45 drochner ((x) > (y) || (y) > (x)))
441 1.49 christos double fdim(double, double);
442 1.59 matt double fma(double, double, double);
443 1.49 christos double fmax(double, double);
444 1.49 christos double fmin(double, double);
445 1.49 christos float fdimf(float, float);
446 1.59 matt float fmaf(float, float, float);
447 1.49 christos float fmaxf(float, float);
448 1.49 christos float fminf(float, float);
449 1.49 christos long double fdiml(long double, long double);
450 1.59 matt long double fmal(long double, long double, long double);
451 1.49 christos long double fmaxl(long double, long double);
452 1.49 christos long double fminl(long double, long double);
453 1.35 drochner
454 1.29 kleink #endif /* !_ANSI_SOURCE && ... */
455 1.29 kleink
456 1.34 kleink #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) || \
457 1.34 kleink !defined(_XOPEN_SOURCE) || \
458 1.34 kleink ((__STDC_VERSION__ - 0) >= 199901L) || \
459 1.34 kleink ((_POSIX_C_SOURCE - 0) >= 200112L) || \
460 1.34 kleink defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
461 1.34 kleink /* 7.12.3.3 int isinf(real-floating x) */
462 1.34 kleink #ifdef __isinf
463 1.34 kleink #define isinf(__x) __isinf(__x)
464 1.34 kleink #else
465 1.34 kleink #define isinf(__x) __fpmacro_unary_floating(isinf, __x)
466 1.34 kleink #endif
467 1.34 kleink
468 1.34 kleink /* 7.12.3.4 int isnan(real-floating x) */
469 1.34 kleink #ifdef __isnan
470 1.34 kleink #define isnan(__x) __isnan(__x)
471 1.34 kleink #else
472 1.34 kleink #define isnan(__x) __fpmacro_unary_floating(isnan, __x)
473 1.34 kleink #endif
474 1.34 kleink #endif /* !_ANSI_SOURCE && ... */
475 1.34 kleink
476 1.25 bjh21 #if defined(_NETBSD_SOURCE)
477 1.11 tv #ifndef __cplusplus
478 1.40 perry int matherr(struct exception *);
479 1.11 tv #endif
480 1.6 jtc
481 1.6 jtc /*
482 1.6 jtc * IEEE Test Vector
483 1.6 jtc */
484 1.40 perry double significand(double);
485 1.1 cgd
486 1.6 jtc /*
487 1.6 jtc * Functions callable from C, intended to support IEEE arithmetic.
488 1.6 jtc */
489 1.40 perry double copysign(double, double);
490 1.40 perry double scalbn(double, int);
491 1.59 matt double scalbln(double, long);
492 1.6 jtc
493 1.6 jtc /*
494 1.6 jtc * BSD math library entry points
495 1.6 jtc */
496 1.40 perry double drem(double, double);
497 1.6 jtc
498 1.25 bjh21 #endif /* _NETBSD_SOURCE */
499 1.12 kleink
500 1.25 bjh21 #if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
501 1.6 jtc /*
502 1.6 jtc * Reentrant version of gamma & lgamma; passes signgam back by reference
503 1.6 jtc * as the second argument; user must allocate space for signgam.
504 1.6 jtc */
505 1.40 perry double gamma_r(double, int *);
506 1.40 perry double lgamma_r(double, int *);
507 1.25 bjh21 #endif /* _NETBSD_SOURCE || _REENTRANT */
508 1.9 jtc
509 1.9 jtc
510 1.25 bjh21 #if defined(_NETBSD_SOURCE)
511 1.15 kleink
512 1.9 jtc /* float versions of ANSI/POSIX functions */
513 1.22 simonb
514 1.40 perry float gammaf(float);
515 1.40 perry int isinff(float);
516 1.40 perry int isnanf(float);
517 1.40 perry int finitef(float);
518 1.40 perry float j0f(float);
519 1.40 perry float j1f(float);
520 1.40 perry float jnf(int, float);
521 1.40 perry float y0f(float);
522 1.40 perry float y1f(float);
523 1.40 perry float ynf(int, float);
524 1.22 simonb
525 1.40 perry float scalbf(float, float);
526 1.9 jtc
527 1.9 jtc /*
528 1.9 jtc * float version of IEEE Test Vector
529 1.9 jtc */
530 1.40 perry float significandf(float);
531 1.9 jtc
532 1.9 jtc /*
533 1.9 jtc * float versions of BSD math library entry points
534 1.9 jtc */
535 1.40 perry float dremf(float, float);
536 1.25 bjh21 #endif /* _NETBSD_SOURCE */
537 1.9 jtc
538 1.25 bjh21 #if defined(_NETBSD_SOURCE) || defined(_REENTRANT)
539 1.9 jtc /*
540 1.9 jtc * Float versions of reentrant version of gamma & lgamma; passes
541 1.9 jtc * signgam back by reference as the second argument; user must
542 1.9 jtc * allocate space for signgam.
543 1.9 jtc */
544 1.40 perry float gammaf_r(float, int *);
545 1.40 perry float lgammaf_r(float, int *);
546 1.12 kleink #endif /* !... || _REENTRANT */
547 1.9 jtc
548 1.29 kleink /*
549 1.29 kleink * Library implementation
550 1.29 kleink */
551 1.40 perry int __fpclassifyf(float);
552 1.40 perry int __fpclassifyd(double);
553 1.40 perry int __isfinitef(float);
554 1.40 perry int __isfinited(double);
555 1.40 perry int __isinff(float);
556 1.40 perry int __isinfd(double);
557 1.40 perry int __isnanf(float);
558 1.40 perry int __isnand(double);
559 1.40 perry int __signbitf(float);
560 1.40 perry int __signbitd(double);
561 1.29 kleink
562 1.29 kleink #ifdef __HAVE_LONG_DOUBLE
563 1.40 perry int __fpclassifyl(long double);
564 1.40 perry int __isfinitel(long double);
565 1.40 perry int __isinfl(long double);
566 1.40 perry int __isnanl(long double);
567 1.40 perry int __signbitl(long double);
568 1.29 kleink #endif
569 1.55 joerg
570 1.1 cgd __END_DECLS
571 1.1 cgd
572 1.1 cgd #endif /* _MATH_H_ */
573