libfxd 0.2.dev
A fixed-point library for C++.
Loading...
Searching...
No Matches
casting.hpp File Reference
#include <type_traits>
#include "concepts.hpp"
#include "detail/bias.hpp"
#include "detail/shift.hpp"

Go to the source code of this file.

Namespaces

namespace  fxd
 This is the namespace where the entire library is defined.
 

Functions

template<fixed_point Dst, fixed_point Src>
constexpr Dst fixed_cast (Src src) noexcept
 Convert a fixed point to a different type of fixed point.
 
template<int Int, int Frac, typename Raw = detail::select_int_t<Int + Frac>, fixed_point Src>
constexpr fixed< Int, Frac, Raw > fixed_cast (Src src) noexcept
 Convert a fixed point to a different type of fixed point.
 
template<int Int, int Frac, typename Raw = detail::select_uint_t<Int + Frac>, fixed_point Src>
constexpr fixed< Int, Frac, Raw > ufixed_cast (Src src) noexcept
 Convert a fixed point to a different type of fixed point (unsigned version.)