Subversion Repositories Kolibri OS

Rev

Rev 4872 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.  * infinity () returns the representation of infinity.
  3.  * Added by Cygnus Support.
  4.  */
  5.  
  6. /*
  7. FUNCTION
  8.         <<infinity>>, <<infinityf>>--representation of infinity
  9.  
  10. INDEX
  11.         infinity
  12. INDEX
  13.         infinityf
  14.  
  15. ANSI_SYNOPSIS
  16.         #include <math.h>
  17.         double infinity(void);
  18.         float infinityf(void);
  19.  
  20. DESCRIPTION
  21.         <<infinity>> and <<infinityf>> return the special number IEEE
  22.         infinity in double- and single-precision arithmetic
  23.         respectively.
  24.  
  25. PORTABILITY
  26. <<infinity>> and <<infinityf>> are neither standard C nor POSIX.  C and
  27. POSIX require macros HUGE_VAL and HUGE_VALF to be defined in math.h, which
  28. Newlib defines to be infinities corresponding to these archaic infinity()
  29. and infinityf() functions in floating-point implementations which do have
  30. infinities.
  31.  
  32. QUICKREF
  33.         infinity - pure
  34.  
  35. */
  36.  
  37. #include "fdlibm.h"
  38.  
  39. #ifndef _DOUBLE_IS_32BITS
  40.  
  41.         double infinity()
  42. {
  43.         double x;
  44.  
  45.         INSERT_WORDS(x,0x7ff00000,0);
  46.         return x;
  47. }
  48.  
  49. #endif /* _DOUBLE_IS_32BITS */
  50.