decided to panic with beaten here. So: I wanted to withdraw all bits of the whole, but not dividing, but beaten.

```
string s = "";
int x = 67542;
For (int i = Sizeof (int) * 8-1; i & gt; = 0; i--)
S + = ((X & amp; 1 & lt; & lt; i)? '1': '0');
COUT & LT; & LT; s;
```

with int everything works very well. Displays 00000000000001000001111101010110

But something is wrong with Long Long (Signed / unsigned). Displays 0000000000000100000111110101111110101100000000000000000000011111010110

It seems like a number repeats twice. In theory, it should bring a bunch of zeros in front.

```
string s = "";
Long Long unsigned x = 67542;
For (int i = SizeOf (Long Unsigned) * 8-1; i & gt; = 0; i--)
S + = ((X & amp; 1 & lt; & lt; i)? '1': '0');
COUT & LT; & LT; s;
```

Main question: why is it going on?

## Answer 1, Authority 100%

Here

```
(x & amp; 1 & lt; & lt; i)
```

The compiler believes that 1 you have `int `

. And should be `unsigned long long `

, otherwise it will simply be UB with large `I `

.

```
(x & amp; 1ull & lt; & lt; i)
```

Try so …

## Answer 2

Code:

```
std :: uint64_t number = 0xffffffff
For (int shift = 63; SHIFT & GT; = 0; --Shift)
STD :: COUT & LT; & LT; ((Number & gt; & gt; shift) & amp; 1);
```

Output:

```
0000000000000000000000000000000011111111111111111111111111111111
```

Template:

```
template & lt; TypeName T & GT;
Concept Integral = STD :: is_integral_v & lt; T & GT ;;
Template & lt; Integral T & GT;
Void Binrep (Const T Number)
{
for (int shift = sizeof (t) * 8 - 1; shift & gt; = 0; --shift)
STD :: CLOG & LT; & LT; ((Number & gt; & gt; shift) & amp; 1);
STD :: CLOG & LT; & LT; STD :: ENDL;
}
```