Biraz gelen yüzen LSB için MSB bir pozisyon bu yüzen kadar her zaman hareket eden üst kabın:
0000
0001
0010
0100
1000
Bir bit en üste geldiğinde, başka bir bit yolculuğuna başlar ve diğer bit ile karşılaştığında durur:
1001
1010
1100
Bu, kap bitlerle doluncaya kadar olur:
1101
1110
1111
Meydan okuma
Bir tamsayı numarası verildiğinde , bu sayıda bit içeren bir kapsayıcı için " Bit yüzer dizisi " verilir.
- Dizinin her terimi, seçtiğiniz herhangi bir ayırıcı ile ayrılabilir.
- Düzenleme : Sıra, ilk termo: dan başlayarak ondalık sayı olarak gösterilmelidir
0
. - Kap boyutu, sıfırdan büyük ve seçtiğiniz dilin sahip olduğu en büyük tamsayının bit sayısına kadar olabilir. Girişin her zaman bu gereksinime uyduğunu varsayabilirsiniz.
Örnekler
Sadece sayısal dizi gereklidir, ikili gösterimler örnek olarak gösterilmiştir:
For 1 :
0 1
0 -> 0 1 -> 1
İçin 3 :
0 1 2 4 5 6 7
000 -> 0 001 -> 1 010 -> 2 100 -> 4 101 -> 5 110 -> 6 111 -> 7
İçin 4 :
0 1 2 4 8 9 10 12 13 14 15
0000 -> 0 0001 -> 1 0010 -> 2 0100 -> 4 1000 -> 8 1001 -> 9 1010 -> 10 1100 -> 12 1101 -> 13 1110 -> 14 1111 -> 15
İçin 8 :
0 1 2 4 8 16 32 64 128 129 130 132 136 144 160 192 193 194 196 200 208 224 225 226 228 232 240 241 242 244 248 249 250 252 253 254 255
00000000 -> 0 00000001 -> 1 00000010 -> 2 00000100 -> 4 00001000 -> 8 … … … 11111000 -> 248 11111001 -> 249 11111010 -> 250 11111100 -> 252 11111101 -> 253 11111110 -> 254 11111111 -> 255
[0.0, 1.0]
0 -> [0, 1]