Two identical strings: Difference between revisions

Content added Content deleted
No edit summary
Line 2,168: Line 2,168:


Function DecToBin$(decNum)
Function DecToBin$(decNum)
If decNum < 0 Then
While decNum
decNum = (65535 + decNum + 1)
R = (decNum Mod 2)
DecToBin$ = R;DecToBin$
End If
If ((decNum <> 0) And (decNum = Int(decNum))) Then
decNum = Int(decNum/ 2)
Wend
decNum = Abs(decNum)
If (DecToBin$ = "") Then DecToBin$ = "0"
Do
If (decNum And 2^i) Then
DecToBin$ = "1" + DecToBin$
Else
DecToBin$ = "0" + DecToBin$
End If
i = i + 1
Loop Until (2^i > decNum)
Else
DecToBin$ = "0"
End If
End Function</lang>
End Function</lang>