bits.h 894 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * include/bits.h
  3. *
  4. * This work was supported by the Director, Office of Science, Division
  5. * of Mathematical, Information, and Computational Sciences of the
  6. * U.S. Department of Energy under contract number DE-AC03-76SF00098.
  7. *
  8. * Copyright (c) 2000-2001
  9. *
  10. * This file defines various routines to get / set bits of a IEEE floating
  11. * point number. This is used by the library for debugging purposes.
  12. */
  13. #ifndef _QD_BITS_H
  14. #define _QD_BITS_H
  15. #include <iostream>
  16. #include <qd/qd_config.h>
  17. /* Returns the exponent of the double precision number.
  18. Returns INT_MIN is x is zero, and INT_MAX if x is INF or NaN. */
  19. int get_double_expn(double x);
  20. /* Prints
  21. SIGN EXPN MANTISSA
  22. of the given double. If x is NaN, INF, or Zero, this
  23. prints out the strings NaN, +/- INF, and 0. */
  24. void print_double_info(std::ostream &os, double x);
  25. #endif /* _QD_BITS_H */