About calculator benchmark (8 queens) and fast devices. MS challenge #2
05-02-2017, 08:00 PM (This post was last modified: 05-02-2017 08:03 PM by pier4r.)
Post: #4
 pier4r Senior Member Posts: 2,056 Joined: Nov 2014
RE: About calculator benchmark (8 queens) and fast devices. MS challenge #2
(05-02-2017 07:15 PM)toml_12953 Wrote:
(05-02-2017 05:18 PM)pier4r Wrote:  How does extract_middle_digits work?
Given n, that is a power of 10 of the type 10^d,
its square is equal to 10^(d*2) and it has (d*2+1) digits.

We consider only the last (d*2) digits.
That is: if n=10000, 10000*10000 = 100000000 we consider only 00000000 without the first 1.

Then we 'consider' all the numbers lower than 10^(d*2) with (d*2) digits.
For example if d=4 and the number under process is 1542,
we consider 1542^2 as 02377764 instead of 2377764.

After that we pick the d=4 middle digits, from 02377764 we pick 0264.
So the middle number extracted is 3777.

Sorry to be dense but I don't get it. Is d = log(n)? If so then log(1542) is 3.188... How do you get d=4?

Tom L

Nothing about "to be dense", it is just my explanation not clear.

In the example I'm using 1542, therefore the numbers used as seed are from 1000 to 9999. So we need seeds with 4 digits (or considered as having 4 digits, in the case of leading zeroes).

You can see it also from n. n is 100^2 or 10000 in the example, without considering the leading 1, those are 4 digits.

@Claudio: I gave a shot on the real hw, but moving back and forth from the 2.15 hw (that is more comfortable to use with frequent changes) is not really feasible for me because the alternative is to frequently use the sd card. For that I need a second 50g. I will check ebay until I get one for a low price. Anyway thanks for the info, at least now I know.

Wikis are great, Contribute :)
 « Next Oldest | Next Newest »