{
for (int64_t y = max(0L, bounds.y); y <= min(bounds.y + bounds.h, target.h-1); ++y)
{
- double dx = 2.0*(double)(x - centre_x)/(double)(bounds.w);
- double dy = 2.0*(double)(y - centre_y)/(double)(bounds.h);
+ Real dx(2); dx *= Real(x - centre_x)/Real(bounds.w);
+ Real dy(2); dy *= Real(y - centre_y)/Real(bounds.h);
int64_t index = (x+target.w*y)*4;
- if (dx*dx + dy*dy <= 1.0)
+ if (dx*dx + dy*dy <= Real(1))
{
target.pixels[index+0] = 0;
target.pixels[index+1] = 0;
target.pixels[index+2] = 0;
target.pixels[index+3] = 255;
-
}
}
}
#include "gmpint.h"
#include "arbint.h"
-#define TEST_CASES 100
+
using namespace IPDF;
int main(int argc, char ** argv)
{
- for (unsigned i = 0; i < TEST_CASES; ++i)
+ unsigned test_cases = (argc > 1) ? atoi(argv[1]) : 100;
+ for (unsigned i = 0; i < test_cases; ++i)
{
uint64_t a = rand();
gmp_a *= b;
}
+
+ for (unsigned j = 0; j < 5; ++j)
+ {
+ arb_a += b;
+ gmp_a += b;
+ }
+
for (unsigned j = 0; j < 5; ++j)
{
arb_a /= b;
}
+ for (unsigned j = 0; j < 5; ++j)
+ {
+ arb_a -= b;
+ gmp_a -= b;
+ }
}
return 0;
}