GP-2985 Remove "using namespace" directives

This commit is contained in:
caheckman 2023-01-05 16:11:42 -05:00
parent 79c0f3f1de
commit 8b442eac0b
20 changed files with 127 additions and 42 deletions

View file

@ -15,10 +15,20 @@
* limitations under the License.
*/
#include "float.hh"
#include <sstream>
#include <cmath>
#include "address.hh"
#include <cmath>
using std::ldexp;
using std::frexp;
using std::signbit;
using std::isnan;
using std::isinf;
using std::sqrt;
using std::floor;
using std::ceil;
using std::round;
using std::fabs;
/// Set format for a given encoding size according to IEEE 754 standards
/// \param sz is the size of the encoding in bytes
FloatFormat::FloatFormat(int4 sz)
@ -79,10 +89,10 @@ FloatFormat::floatclass FloatFormat::extractExpSig(double x,bool *sgn,uintb *sig
{
int4 e;
*sgn = std::signbit(x);
*sgn = signbit(x);
if (x == 0.0) return zero;
if (std::isinf(x)) return infinity;
if (std::isnan(x)) return nan;
if (isinf(x)) return infinity;
if (isnan(x)) return nan;
if (*sgn)
x = -x;
double norm = frexp(x,&e); // norm is between 1/2 and 1
@ -232,11 +242,13 @@ double FloatFormat::getHostFloat(uintb encoding,floatclass *type) const
else if (exp == maxexponent) {
if ( frac == 0 ) { // Floating point infinity
*type = infinity;
return sgn ? -INFINITY : +INFINITY;
double infinity = std::numeric_limits<double>::infinity();
return sgn ? -infinity : +infinity;
}
*type = nan;
// encoding is "Not a Number" NaN
return sgn ? -NAN : +NAN; // Sign is usually ignored
double nan = std::numeric_limits<double>::quiet_NaN();
return sgn ? -nan : +nan; // Sign is usually ignored
}
else
*type = normalized;