trionan.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*************************************************************************
  2. *
  3. * $Id$
  4. *
  5. * Copyright (C) 2001 Bjorn Reese <breese@users.sourceforge.net>
  6. *
  7. * Permission to use, copy, modify, and distribute this software for any
  8. * purpose with or without fee is hereby granted, provided that the above
  9. * copyright notice and this permission notice appear in all copies.
  10. *
  11. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  12. * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  13. * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  14. * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  15. *
  16. ************************************************************************/
  17. #ifndef TRIO_NAN_H
  18. #define TRIO_NAN_H
  19. #include "triodef.h"
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. enum {
  24. TRIO_FP_INFINITE,
  25. TRIO_FP_NAN,
  26. TRIO_FP_NORMAL,
  27. TRIO_FP_SUBNORMAL,
  28. TRIO_FP_ZERO
  29. };
  30. /*
  31. * Return NaN (Not-a-Number).
  32. */
  33. TRIO_PUBLIC double trio_nan TRIO_PROTO((void));
  34. /*
  35. * Return positive infinity.
  36. */
  37. TRIO_PUBLIC double trio_pinf TRIO_PROTO((void));
  38. /*
  39. * Return negative infinity.
  40. */
  41. TRIO_PUBLIC double trio_ninf TRIO_PROTO((void));
  42. /*
  43. * Return negative zero.
  44. */
  45. TRIO_PUBLIC double trio_nzero TRIO_PROTO((TRIO_NOARGS));
  46. /*
  47. * If number is a NaN return non-zero, otherwise return zero.
  48. */
  49. TRIO_PUBLIC int trio_isnan TRIO_PROTO((double number));
  50. /*
  51. * If number is positive infinity return 1, if number is negative
  52. * infinity return -1, otherwise return 0.
  53. */
  54. TRIO_PUBLIC int trio_isinf TRIO_PROTO((double number));
  55. /*
  56. * If number is finite return non-zero, otherwise return zero.
  57. */
  58. #if 0
  59. /* Temporary fix - these 2 routines not used in libxml */
  60. TRIO_PUBLIC int trio_isfinite TRIO_PROTO((double number));
  61. TRIO_PUBLIC int trio_fpclassify TRIO_PROTO((double number));
  62. #endif
  63. TRIO_PUBLIC int trio_signbit TRIO_PROTO((double number));
  64. TRIO_PUBLIC int trio_fpclassify_and_signbit TRIO_PROTO((double number, int *is_negative));
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* TRIO_NAN_H */