vlahonick vlahonick a écrit :
hello all :D
i am trying to create a program that calculates a number from the binary
numeral system and gives a result
example of what the program will do :
we have the number (at binary numeral system) 10011
so to have result we have to do
hello all :D
i am trying to create a program that calculates a number from the binary
numeral system and gives a result
example of what the program will do :
we have the number (at binary numeral system) 10011
so to have result we have to do (1*2^4)+(0*2^3)+(0*2^2)+(1*2^1)+(1*2^0)=
vlahonick vlahonick a écrit :
hello all :D
i am trying to create a program that calculates a number from the binary
numeral system and gives a result
example of what the program will do :
we have the number (at binary numeral system) 10011
so to have result we have to do
...@wanadoo.fr]
Gesendet: Dienstag, 14. April 2009 14:04
An: mailing list for gambas users
Betreff: Re: [Gambas-user] binary numeral system
vlahonick vlahonick a écrit :
hello all :D
i am trying to create a program that calculates a number from the binary
numeral system and gives a result
users
Betreff: Re: [Gambas-user] binary numeral system
vlahonick vlahonick a écrit :
hello all :D
i am trying to create a program that calculates a number from the binary
numeral system and gives a result
example of what the program will do :
we have the number (at binary numeral
Ron_1st a écrit :
On Tuesday 14 April 2009, Simonart Dominique wrote:
PUBLIC SUB Button1_Click()
DIM S AS String
DIM i, y, N AS Integer
S = TextArea1.Text
y = Len(S)
if y = 0 THEN RETURN
N = 0
FOR i = 1 to y
d = Val(Mid(S, i, 1)) ' I assume that d is 0 or 1
That's pretty cool.
My only comment would be that it took me a few goes at stepping through the
code before I worked out how the blazes it worked, so perhaps less readable
than the exponent version.
But hey - I'm no rocket scientist :-)
From: ron...@tiscali.nl
function bin2dec(sBin)