Question: i paste a code that i found to centralize the content of container, but now im trying to use float:left and right and the divs are not going to the side.
Link for codepen of this code: <https://codepen.io/racr-1/pen/oNqoZVQ>

```css
.container {
  width: 65%;
  border: 1px solid black;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.div1 {
  width: 100px;
  height: 100px;
  background-color: aqua;
  float: left;
}

.div2 {
  width: 100px;
  height: 100px;
  background-color: red;
  float: right;
}
```

```html
<!DOCTYPE html>
<html lang="en">

<body>
  <div class="container">
    <h1>content of h1</h1>
    <div class="div1"></div>
    <div class="div2"></div>
  </div>
</body>

</html>
```

Answer: 
Although as the other answer indicates it is undefined behavior per standard to instantiate `std::uniform_int_distribution` with `uint8_t` template argument, the UBsan warning here is unrelated to that.

UBSan is flagging the implementation of the Mersenne twister itself, but the implementation doesn't have any undefined behavior or bug.

If you look closely you see that the offending expression is

```
_M_x[__k + (__m - __n)]

```

where `__k` is a value in the range from `(__n - __m)` to `(__n - 1)` via the `for` loop.

All of the types involved in these operations are `std::size_t` which is unsigned. As a consequence these operations all use modular arithmetic and therefore even if `__m - __n` is negative and not representable in the unsigned type, the result of

```
__k + (__m - __n)

```

will lie between `0` and `__m - 1`, so that indexing the array with it is not a problem. No undefined behavior, unspecified behavior or implementation-defined behavior is involved.

The UBSan check which is flagging this is not flagging actual undefined behavior. It is perfectly ok to rely on the wrap-around behavior of unsigned arithmetic like this if one is aware of it. The unsigned overflow check is only meant to be used to flag instances of such wrap-around where it was not intentional. You shouldn't use it on other's code that might rely on it or on your own code if you might be relying on it.

In `-fsanitize=address,undefined,nullability,implicit-integer-truncation,implicit-integer-arithmetic-value-change,implicit-conversion,integer` all except `address` and `undefined` enable UBsan checks which are not flagging actual undefined behavior, but conditions that *may* be unintentional in many cases. The default `-fsanitize=undefined` sanitizer flag doesn't enable the unsigned integer overflow check by default for the reasons given above. See <https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html> for details.
The result of using `uint8_t` in a [`std::uniform_int_distribution`](https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution) is undefined, so:

```cpp
std::uniform_int_distribution<uint8_t> dd(0, 255); // Don't do this!

```

You can use any of `short`, `int`, `long`, `long long`, `unsigned short`, `unsigned int`, `unsigned long`, or `unsigned long long` instead.

Quote from [`rand.req.gen`/1.5](https://eel.is/c++draft/rand.req.genl#1.5)

> 
> Throughout this subclause [rand], the effect of instantiating a template:  
> 
> that has a template type parameter named `IntType` is undefined unless the corresponding template argument is cv-unqualified and is one of `short`, `int`, `long`, `long long`, `unsigned short`, `unsigned int`, `unsigned long`, or `unsigned long long`.
> 
> 
> 

If that doesn't help, skip the `-fsanitize=integer` option since

> 
> `-fsanitize=integer`: Checks for undefined or suspicious integer behavior (e.g. **unsigned** integer overflow). Enables `signed-integer-overflow`
> 
> 
> 

... and unsigned integer overflow does *not* have *undefined behavior*. The check for *signed* integer overflow will be automatically enabled by using `-fsanitize=undefined` so you don't have to enable that separately.

If that still doesn't help, it could be a bug in the gcc library implementation used by `clang++` that causes this. You can try using `clang++`'s library implementation to see if that helps:

```
clang++ -stdlib=libc++ ...

```