24#ifndef MY_DOUBLE2ULONGLONG_INCLUDED
25#define MY_DOUBLE2ULONGLONG_INCLUDED
35inline unsigned long long my_double2ulonglong(
double d) {
36 const double t = d - (double)0x8000000000000000ULL;
38 if (t >= 0)
return ((
unsigned long long)t) + 0x8000000000000000ULL;
39 return (
unsigned long long)d;
41#define double2ulonglong my_double2ulonglong
44#ifndef ulonglong2double
45#define ulonglong2double(A) ((double)(ulonglong)(A))
46#define my_off_t2double(A) ((double)(my_off_t)(A))
48#ifndef double2ulonglong
49#define double2ulonglong(A) ((ulonglong)(double)(A))
static constexpr int64_t MIN_EXACT_INTEGER_FLOAT
Definition: my_double2ulonglong.h:68
static constexpr double LLONG_MAX_DOUBLE
Definition: my_double2ulonglong.h:56
static constexpr double ULLONG_MAX_DOUBLE
Definition: my_double2ulonglong.h:59
static constexpr int64_t MAX_EXACT_INTEGER_DOUBLE
Definition: my_double2ulonglong.h:63
static constexpr int64_t MAX_EXACT_INTEGER_FLOAT
Definition: my_double2ulonglong.h:67
static constexpr int64_t MIN_EXACT_INTEGER_DOUBLE
Definition: my_double2ulonglong.h:64
Some integer typedefs for easier portability.