I think I have fixed it in terms of the math, by limiting the base it goes through, however the 'leading' zero in the final string that's printed is missing :
From what I can tell, the issue is in this piece:
Print(" bin number = "+str(binary_val))
Print(" dec number = "+str(decimal_val))
[b]convert$ = bin(decimal_val)
[/b] Print(convert$+" binary")
valu is just an array converted to string to integer; might also be the issue, but the math seems correct, so I'm confused:
valu = val(str(orig_gene[0,0])+str(orig_gene[0,1])+str(orig_gene[0,2])+str(orig_gene[0,3])+str(orig_gene[0,4]))
conv_bin(valu)
Here's the extremely basic conversion code:
function conv_bin(num)
while base <32 // 2x2x2x2x2= 32 ; string length
remm = mod(num,10)
decimal_val = decimal_val + remm *base
num = num / 10
base = base * 2
endwhile
endfunction