Skip to content

Commit

Permalink
small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarzlichtbezirk committed Feb 7, 2018
1 parent 935f0ca commit ba762f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Buddhabrot/Buddhabrot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void buddhabrot::render(
nsum = 0;

int i, j, n, ix, iy;
double x, y, x0, y0, xnew, ynew;
number x, y, x0, y0, xnew, ynew;

// Coordinates sequence
std::vector<point> xyseq(nmax);
Expand All @@ -31,13 +31,13 @@ void buddhabrot::render(

std::vector<color> ct(nmax);
color* ctp = ct.data();
for (int i = 0; i < ct.size(); i++) {
ctp[i] = hue((double)i / nmax);
for (size_t i = 0; i < ct.size(); i++) {
ctp[i] = hue((number)i / nmax);
}

// Make unique random sequence
std::mt19937_64 prng(std::chrono::high_resolution_clock::now().time_since_epoch().count() + quote);
std::uniform_real_distribution<double> distribution(0.0, 1.0);
std::uniform_real_distribution<number> distribution(0.0, 1.0);

// Iterate
int i1 = quote * frames / pool, i2 = (quote + 1) * frames / pool;
Expand Down
2 changes: 1 addition & 1 deletion Buddhabrot/param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ int __cdecl wmain(int argc, wchar_t *argv[]) {
number dur = g.rendermt(pool, img, color::rainbow, true);
std::wcout << L"\r" << dur << L"s " << std::endl;
std::wcout << L"discard points: " << (100. * buddhabrot::numdiscard / frames) << L"%" << std::endl;
std::wcout << L"average bailout: " << ((double)buddhabrot::nsum / (frames - buddhabrot::numdiscard)) << std::endl;
std::wcout << L"average bailout: " << ((number)buddhabrot::nsum / (frames - buddhabrot::numdiscard)) << std::endl;
std::wcout << L"total iterations: " << (buddhabrot::nsum / 1e6) << L"M" << std::endl;

// Save image
Expand Down
2 changes: 2 additions & 0 deletions Clifford/script.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<CallingConvention>FastCall</CallingConvention>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -151,6 +152,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<CallingConvention>FastCall</CallingConvention>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
2 changes: 1 addition & 1 deletion luaattractors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ LUNA_DECLEX(luaimage, clear) {

LUNA_DECLEX(luaimage, writetga) {
auto filename = luaL_checkwstr(L, 1);
auto sensitivity = (double)luaL_optnumber(L, 2, 0.02);
auto sensitivity = (number)luaL_optnumber(L, 2, 0.02);
writetga(filename.c_str(), sensitivity);
return 0;
}
Expand Down

0 comments on commit ba762f4

Please sign in to comment.