-1

294284941888956266345982392040522594123776
Now comes the cheating:

Dim i As String
Dim L As Integer
Dim j As Integer
Dim m As Integer
Dim sM As String
Dim Doubled As String
Dim CarryFlag As Integer

i = "73571235472239066586495598010130648530944"

L = LEN(i)

Print L

FOR j = L TO 1 STEP -1
	m = Cast(Integer, Mid(i, j, 1))
	Print "M = "; m
	m = m * 2
	Print "M = "; m; "  CarryFlag = "; CarryFlag	
	IF CarryFlag = 1 THEN
		Print "CarryFlag = 1"
		m = m + 1
		CarryFlag = 0
	END IF
	IF m >= 10 Then
		Print "M = "; m; "  CarryFlag = "; CarryFlag
		m = m - 10
		CarryFlag = 1
	END IF

'PRINT "Counting down: "; MID$(i$, j, 1)

Doubled = str(m) + Doubled
'PRINT j, M
NEXT j
IF CarryFlag = 1 THEN Doubled = "1" + Doubled
PRINT Doubled

Should be good for any number up to 32767 bytes in length.
Compiled with FreeBASIC using the FbEdit IDE.

Votes + Comments
what are you trying to do?
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.