First power of 2 that has leading decimal digits of 12: Difference between revisions
First power of 2 that has leading decimal digits of 12 (view source)
Revision as of 13:50, 10 July 2020
, 3 years ago→{{header|ALGOL 68}}: Correct description in comment.
(Added Wren) |
m (→{{header|ALGOL 68}}: Correct description in comment.) |
||
Line 39:
As wih the Go second sample, computes approximate integer values for the powers of 2.
<br>Requires LONG INT to be at least 64 bits (as in Algol 68G).
<lang algol68># find values of p( L, n ) where p( L, n ) is the nth-smallest j such that
# the decimal representation of 2^j starts with
BEGIN
# returns a string representation of n with commas #
|