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.

95 lines
3.2 KiB

  1. /* $OpenBSD: float.h,v 1.1 2012/06/26 16:16:16 deraadt Exp $ */
  2. /*
  3. * Copyright (c) 1989 Regents of the University of California.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. Neither the name of the University nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  19. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. */
  30. #ifndef _FLOAT_H_
  31. #define _FLOAT_H_
  32. #include <sys/cdefs.h>
  33. #include <machine/_float.h>
  34. __BEGIN_DECLS
  35. int __flt_rounds(void);
  36. __END_DECLS
  37. #define FLT_RADIX __FLT_RADIX /* b */
  38. #define FLT_ROUNDS __FLT_ROUNDS
  39. #if __ISO_C_VISIBLE >= 1999
  40. #define FLT_EVAL_METHOD __FLT_EVAL_METHOD /* long double */
  41. #endif
  42. #define FLT_MANT_DIG __FLT_MANT_DIG /* p */
  43. #define FLT_EPSILON __FLT_EPSILON /* b**(1-p) */
  44. #ifndef FLT_DIG
  45. #define FLT_DIG __FLT_DIG /* floor((p-1)*log10(b))+(b == 10) */
  46. #endif
  47. #define FLT_MIN_EXP __FLT_MIN_EXP /* emin */
  48. #ifndef FLT_MIN
  49. #define FLT_MIN __FLT_MIN /* b**(emin-1) */
  50. #endif
  51. #define FLT_MIN_10_EXP __FLT_MIN_10_EXP /* ceil(log10(b**(emin-1))) */
  52. #define FLT_MAX_EXP __FLT_MAX_EXP /* emax */
  53. #ifndef FLT_MAX
  54. #define FLT_MAX __FLT_MAX /* (1-b**(-p))*b**emax */
  55. #endif
  56. #define FLT_MAX_10_EXP __FLT_MAX_10_EXP /* floor(log10((1-b**(-p))*b**emax)) */
  57. #define DBL_MANT_DIG __DBL_MANT_DIG
  58. #define DBL_EPSILON __DBL_EPSILON
  59. #ifndef DBL_DIG
  60. #define DBL_DIG __DBL_DIG
  61. #endif
  62. #define DBL_MIN_EXP __DBL_MIN_EXP
  63. #ifndef DBL_MIN
  64. #define DBL_MIN __DBL_MIN
  65. #endif
  66. #define DBL_MIN_10_EXP __DBL_MIN_10_EXP
  67. #define DBL_MAX_EXP __DBL_MAX_EXP
  68. #ifndef DBL_MAX
  69. #define DBL_MAX __DBL_MAX
  70. #endif
  71. #define DBL_MAX_10_EXP __DBL_MAX_10_EXP
  72. #define LDBL_MANT_DIG __LDBL_MANT_DIG
  73. #define LDBL_EPSILON __LDBL_EPSILON
  74. #define LDBL_DIG __LDBL_DIG
  75. #define LDBL_MIN_EXP __LDBL_MIN_EXP
  76. #define LDBL_MIN __LDBL_MIN
  77. #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP
  78. #define LDBL_MAX_EXP __LDBL_MAX_EXP
  79. #define LDBL_MAX __LDBL_MAX
  80. #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP
  81. #if __ISO_C_VISIBLE >= 1999
  82. #define DECIMAL_DIG __DECIMAL_DIG
  83. #endif
  84. #endif /* _FLOAT_H_ */