Talk:Rare numbers: Difference between revisions

→‎Tweaks, Go (Turbo): Replied to Enter your username.
m (→‎Tweaks, Go (Turbo): added remark about long)
(→‎Tweaks, Go (Turbo): Replied to Enter your username.)
Line 911:
 
:: I also installed gmp and tried the c++ 20+ digit version, but found issues. 10, 12, & 13 had normal output, but digits 14 and up spent the approximate calculation time without producing any solutions. Has anyone else observed this issue? (By the way, I had to change ''long'' to ''long long'' in either version. Perhaps part of my issue?) --[[User:Enter your username|Enter your username]] ([[User talk:Enter your username|talk]]) 02:30, 23 March 2020 (UTC)
 
::: Ah, just missed sub-10 minutes on the overall time but still impressively fast.
 
::: In C++ the width of the ''long'' type is, of course, implementation dependent and in g++ running on Ubuntu 18.04, amd64, sizeof(long) is 8 bytes. It looks like it's only 4 bytes on the version of mingw you're using (I don't know what Nigel's using), hence the need for ''long long''.
 
::: I haven't looked at the 20+ digit C++ version at all though, at first sight, it looks similar to the 10-19 digit version but with ''long'' replaced where necessary with ''mpz_t''. FWIW, I compiled (g++ -std=c++17 -O3 rare_ng3.cpp -lgmp -lgmpxx -o rare_ng3) and ran it on my machine and whilst it seemed to execute OK it wasn't very fast taking about 1 minute and 7.25 minutes respectively to complete up to and including the 16 and 17 digit blocks - g++ doesn't seem to be even at the races here :(
 
::: I've no idea what could be causing the issues you're having though it may be GMP related as it can be a pig to install correctly. A more fruitful approach might be to try and translate the C++ version to C# using the 128 bit integer library you found rather than System.Numerics.BigInteger though whether this will be any quicker than what you've done already I don't know. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 10:37, 23 March 2020 (UTC)
 
== 21+ digit rare numbers ==
9,485

edits