Talk:Rare numbers: Difference between revisions

m
→‎Tweaks, C++: Further syntax-highlighting fixes
m (→‎Tweaks, Go (Turbo): Edited source to output syntax highlighting correctly for C++ in addition to previously Golang)
m (→‎Tweaks, C++: Further syntax-highlighting fixes)
 
Line 924:
== Tweaks, C++ ==
Wringing out some more performance here, just over 5 minutes for 19 digits by themselves, and just over 6 minutes for digits 2 thru 19. See the code comments for details on what was tweaked. Curiously, I found that the g++ version executes faster than the clang++ version. Compiler arguments used: <code>g++ rare.cpp -o rare.exe -std=c++17 -O3</code><br/>Curious to see if it can go faster on a different platform - But the original executed faster on g++ than clang++ for me on my platform too. Perhaps I don't have clang++ set up the same as others?
<langsyntaxhighlight lang="cpp">// Rare Numbers : Nigel Galloway - December 20th., 2019
 
/*
Line 1,060:
printf("%4s %19s %11s %10s %5s %11s %9s\n", "nth", "forward", "rt.sum", "rt.diff", "digs", "block.et", "total.et");
for (int nd = 2; nd <= max; nd++) Rare(int(nd));
}</langsyntaxhighlight>
{{out}}
Results on the core i7-7700 @ 3.6Ghz.
35

edits