25#ifndef MY_DOUBLE2ULONGLONG_INCLUDED
26#define MY_DOUBLE2ULONGLONG_INCLUDED
36inline unsigned long long my_double2ulonglong(
double d) {
37 const double t = d - (double)0x8000000000000000ULL;
39 if (t >= 0)
return ((
unsigned long long)t) + 0x8000000000000000ULL;
40 return (
unsigned long long)d;
42#define double2ulonglong my_double2ulonglong
45#ifndef ulonglong2double
46#define ulonglong2double(A) ((double)(ulonglong)(A))
47#define my_off_t2double(A) ((double)(my_off_t)(A))
49#ifndef double2ulonglong
50#define double2ulonglong(A) ((ulonglong)(double)(A))
static constexpr int64_t MIN_EXACT_INTEGER_FLOAT
Definition: my_double2ulonglong.h:69
static constexpr double LLONG_MAX_DOUBLE
Definition: my_double2ulonglong.h:57
static constexpr double ULLONG_MAX_DOUBLE
Definition: my_double2ulonglong.h:60
static constexpr int64_t MAX_EXACT_INTEGER_DOUBLE
Definition: my_double2ulonglong.h:64
static constexpr int64_t MAX_EXACT_INTEGER_FLOAT
Definition: my_double2ulonglong.h:68
static constexpr int64_t MIN_EXACT_INTEGER_DOUBLE
Definition: my_double2ulonglong.h:65
Some integer typedefs for easier portability.