Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.9 KiB

- replace dtoa w/ David's gdtoa, version 2008-03-15 - provide proper dtoa locks - use the real strtof implementation - add strtold, __hdtoa, __hldtoa - add %a/%A support - don't lose precision in printf, don't round to double anymore - implement extended-precision versions of libc functions: fpclassify, isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is fixed - separate vax versions of strtof, and __hdtoa - add complex math support. added functions: cacos, casin, catan, ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp, clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf, casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf, ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf, cimagf, conjf, cprojf, crealf - add fdim, fmax, fmin - add log2. (adapted implementation e_log.c. could be more acruate & faster, but it's good enough for now) - remove wrappers & cruft in libm, supposed to work-around mistakes in SVID, etc.; use ieee versions. fixes issues in python 2.6 for djm@ - make _digittoint static - proper definitions for i386, and amd64 in ieee.h - sh, powerpc don't really have extended-precision - add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h for LDBL_* - merge lead to frac for m{6,8}k, for gdtoa to work properly - add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa to use - add EXT_IMPLICIT_NBIT definition, which indicates implicit normalization bit - add regression tests for libc: fpclassify and printf - arith.h & gd_qnan.h definitions - update ieee.h: hppa doesn't have quad-precision, hppa64 does - add missing prototypes to gdtoaimp - on 64-bit platforms make sure gdtoa doesn't use a long when it really wants an int - etc., what i may have forgotten... - bump libm major, due to removed&changed symbols - no libc bump, since this is riding on djm's libc major crank from a day ago discussed with / requested by / testing theo, sthen@, djm@, jsg@, merdely@, jsing@, tedu@, brad@, jakemsr@, and others. looks good to millert@ parts of the diff ok kettenis@ this commit does not include: - man page changes
16 years ago
  1. /* $OpenBSD: complex.h,v 1.5 2014/03/16 18:38:30 guenther Exp $ */
  2. /*
  3. * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _COMPLEX_H_
  18. #define _COMPLEX_H_
  19. #include <sys/cdefs.h>
  20. /*
  21. * C99
  22. */
  23. #ifdef __GNUC__
  24. #if __STDC_VERSION__ < 199901
  25. #define _Complex __complex__
  26. #endif
  27. #define _Complex_I 1.0fi
  28. #endif
  29. #define complex _Complex
  30. /* XXX switch to _Imaginary_I */
  31. #undef I
  32. #define I _Complex_I
  33. __BEGIN_DECLS
  34. /*
  35. * Double versions of C99 functions
  36. */
  37. double complex cacos(double complex);
  38. double complex casin(double complex);
  39. double complex catan(double complex);
  40. double complex ccos(double complex);
  41. double complex csin(double complex);
  42. double complex ctan(double complex);
  43. double complex cacosh(double complex);
  44. double complex casinh(double complex);
  45. double complex catanh(double complex);
  46. double complex ccosh(double complex);
  47. double complex csinh(double complex);
  48. double complex ctanh(double complex);
  49. double complex cexp(double complex);
  50. double complex clog(double complex);
  51. double cabs(double complex);
  52. double complex cpow(double complex, double complex);
  53. double complex csqrt(double complex);
  54. double carg(double complex);
  55. double cimag(double complex);
  56. double complex conj(double complex);
  57. double complex cproj(double complex);
  58. double creal(double complex);
  59. /*
  60. * Float versions of C99 functions
  61. */
  62. float complex cacosf(float complex);
  63. float complex casinf(float complex);
  64. float complex catanf(float complex);
  65. float complex ccosf(float complex);
  66. float complex csinf(float complex);
  67. float complex ctanf(float complex);
  68. float complex cacoshf(float complex);
  69. float complex casinhf(float complex);
  70. float complex catanhf(float complex);
  71. float complex ccoshf(float complex);
  72. float complex csinhf(float complex);
  73. float complex ctanhf(float complex);
  74. float complex cexpf(float complex);
  75. float complex clogf(float complex);
  76. float cabsf(float complex);
  77. float complex cpowf(float complex, float complex);
  78. float complex csqrtf(float complex);
  79. float cargf(float complex);
  80. float cimagf(float complex);
  81. float complex conjf(float complex);
  82. float complex cprojf(float complex);
  83. float crealf(float complex);
  84. /*
  85. * Long double versions of C99 functions
  86. */
  87. long double complex cacosl(long double complex);
  88. long double complex casinl(long double complex);
  89. long double complex catanl(long double complex);
  90. long double complex ccosl(long double complex);
  91. long double complex csinl(long double complex);
  92. long double complex ctanl(long double complex);
  93. long double complex cacoshl(long double complex);
  94. long double complex casinhl(long double complex);
  95. long double complex catanhl(long double complex);
  96. long double complex ccoshl(long double complex);
  97. long double complex csinhl(long double complex);
  98. long double complex ctanhl(long double complex);
  99. long double complex cexpl(long double complex);
  100. long double complex clogl(long double complex);
  101. long double cabsl(long double complex);
  102. long double complex cpowl(long double complex,
  103. long double complex);
  104. long double complex csqrtl(long double complex);
  105. long double cargl(long double complex);
  106. long double cimagl(long double complex);
  107. long double complex conjl(long double complex);
  108. long double complex cprojl(long double complex);
  109. long double creall(long double complex);
  110. __END_DECLS
  111. #endif /* !_COMPLEX_H_ */