home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / mesch12a.zip / dmacheps.c < prev    next >
C/C++ Source or Header  |  1994-01-13  |  1KB  |  47 lines

  1.  
  2. /**************************************************************************
  3. **
  4. ** Copyright (C) 1993 David E. Steward & Zbigniew Leyk, all rights reserved.
  5. **
  6. **                 Meschach Library
  7. ** 
  8. ** This Meschach Library is provided "as is" without any express 
  9. ** or implied warranty of any kind with respect to this software. 
  10. ** In particular the authors shall not be liable for any direct, 
  11. ** indirect, special, incidental or consequential damages arising 
  12. ** in any way from use of the software.
  13. ** 
  14. ** Everyone is granted permission to copy, modify and redistribute this
  15. ** Meschach Library, provided:
  16. **  1.  All copies contain this copyright notice.
  17. **  2.  All modified copies shall carry a notice stating who
  18. **      made the last modification and the date of such modification.
  19. **  3.  No charge is made for this software or works derived from it.  
  20. **      This clause shall not be construed as constraining other software
  21. **      distributed on the same medium as this software, nor is a
  22. **      distribution fee considered a charge.
  23. **
  24. ***************************************************************************/
  25.  
  26.  
  27. #include    <stdio.h>
  28.  
  29. double    dclean(x)
  30. double    x;
  31. {
  32.     static double    y;
  33.     y = x;
  34.     return y;    /* prevents optimisation */
  35. }
  36.  
  37. main()
  38. {
  39.     static double    deps, deps1, dtmp;
  40.  
  41.     deps = 1.0;
  42.     while ( dclean(1.0+deps) > 1.0 )
  43.     deps = 0.5*deps;
  44.  
  45.     printf("%g\n", 2.0*deps);
  46. }
  47.