First power of 2 that has leading decimal digits of 12: Difference between revisions

m
→‎{{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 n the digits of L #
BEGIN
# returns a string representation of n with commas #
1,481

edits