sanisizer
Sanitize sizes to avoid integer overflow
Loading...
Searching...
No Matches
float.hpp File Reference

Safely convert floats to/from integer sizes. More...

#include <limits>
#include <cmath>
#include <stdexcept>
#include <type_traits>
#include "utils.hpp"
#include "attest.hpp"

Go to the source code of this file.

Namespaces

namespace  sanisizer
 Sanitize sizes to avoid integer overflow.
 

Functions

template<typename Integer_ , typename Float_ >
Integer_ sanisizer::from_float (Float_ x)
 
template<typename Float_ , typename Integer_ >
Float_ sanisizer::to_float (Integer_ x)
 

Detailed Description

Safely convert floats to/from integer sizes.