26 double nearly = 1. / 20000000000LL;
75 auto almostBiggest = [&](
int n) {
76 double almostBiggest = biggest;
77 for (
int i = 0;
i < n; ++
i) {
78 almostBiggest = std::nextafter(almostBiggest, -INFINITY);
82 const double nextBiggest = almostBiggest(1);
88 const uint64_t smallestNANPattern =
89 0b0'11111111111'0000000000000000000000000000000000000000000000000001;
91 memcpy(&smallestNAN, &smallestNANPattern,
sizeof(
double));
103 const double smallest = std::numeric_limits<double>::denorm_min();
112 std::array<double, 5>
testCases = {0.0, 1.0, -13.0, 1.234567890123456, -543210.987654321};
116 uint64_t
bits = sk_bit_cast<uint64_t>(input);
122 uint64_t
bits = sk_bit_cast<uint64_t>((
double) NAN);
127 uint64_t
bits = sk_bit_cast<uint64_t>((
double) INFINITY);
135 double over1 = 1+4.656612873e-10;
138 double under1 = 1-4.656612873e-10;
142 double x =
std::fma(1, -1, over1 * under1);
153 const float smallest = std::numeric_limits<float>::denorm_min();
DEF_TEST(DoubleNearlyZero, reporter)
bool sk_double_nearly_zero(double a)
static bool SkIsFinite(T x, Pack... values)
static constexpr float sk_float_midpoint(float a, float b)
bool sk_doubles_nearly_equal_ulps(double a, double b, uint8_t maxUlpsDiff=16)
static skvx::float4 fma(const skvx::float4 &f, float m, const skvx::float4 &a)
#define REPORTER_ASSERT(r, cond,...)
static float max(float r, float g, float b)