| 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 |
|
| 14 |
#ifndef _QD_BITS_H |
| 15 |
#define _QD_BITS_H |
| 16 |
|
| 17 |
#include <iostream> |
| 18 |
#include <qd/qd_config.h> |
| 19 |
|
| 20 |
/* Returns the exponent of the double precision number. |
| 21 |
Returns INT_MIN is x is zero, and INT_MAX if x is INF or NaN. */ |
| 22 |
int get_double_expn(double x); |
| 23 |
|
| 24 |
/* Prints |
| 25 |
SIGN EXPN MANTISSA |
| 26 |
of the given double. If x is NaN, INF, or Zero, this |
| 27 |
prints out the strings NaN, +/- INF, and 0. */ |
| 28 |
void print_double_info(std::ostream &os, double x); |
| 29 |
|
| 30 |
|
| 31 |
#endif /* _QD_BITS_H */ |
| 32 |
|