cast float to unsigned in a proper way
cast std::size_t and unsigned in a proper way