Talk:Zumkeller numbers: Difference between revisions

Content added Content deleted
m (→‎Why this limitation in c++: changing d.size gets the right solution)
Line 47: Line 47:


I took a look and I'm not getting those numbers in the output. Can I see how you unit tested this? I'm not sure why that would matter though... my best guess is an OS dtype issue causing overflow but that seems unlikely. What IDE/OS did you run this on?--[[User:Mckann|Mckann]] ([[User talk:Mckann|talk]]) 03:35, 12 May 2021 (UTC)
I took a look and I'm not getting those numbers in the output. Can I see how you unit tested this? I'm not sure why that would matter though... my best guess is an OS dtype issue causing overflow but that seems unlikely. What IDE/OS did you run this on?--[[User:Mckann|Mckann]] ([[User talk:Mckann|talk]]) 03:35, 12 May 2021 (UTC)
: I think the overflow will happen with 32 Bit aka uint.<br>If you change d.size to >30-Bit it will take a while and find 99504 to be a non-zumkeller number.<lang c++>// if we get here and n is odd it's a zum!
if (n % 2 || d.size() > 30)
return true;</lang>
:Your program is limited to 31 divisors.<BR>I'm testing mostly in the web on TIO.RUN like TIO.RUN/#cpp-gcc to be comparable. d.size >30 takes more than 60s limit :-(<br> [[User:Horsth|Horsth]] ([[User talk:Horsth|talk]]) 06:41, 12 May 2021 (UTC)