Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
runtime_precision.hpp File Reference
#include "precision.hpp"
#include "scalar_traits.hpp"
#include <optional>
Include dependency graph for runtime_precision.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  uni20
 

Functions

template<class T >
requires (!has_runtime_precision_v<std::remove_cvref_t<T>>) && requires { numeric_limits<detail::precision_component_t<T>>::digits(); numeric_limits<detail::precision_component_t<T>>::is_exact; }
constexpr Precision uni20::native_precision ()
 Concrete precision of a fixed scalar family, including complex components.
 
template<class T >
requires requires(T const& value) { value.precision(); } || requires { native_precision<T>(); }
constexpr Precision uni20::precision_of (T const &value)
 Read scalar precision without changing any scalar or provider state.
 
template<class T >
requires (has_runtime_precision_v<std::remove_cvref_t<T>> || requires { native_precision<T>(); })
constexpr void uni20::require_precision (Precision p)
 Reject an operation precision incompatible with a fixed scalar result.
 
template<class S , class V >
requires ((requires { native_precision<S>(); } && std::constructible_from<S, V const&>) || (has_runtime_precision_v<S> && std::constructible_from<S, V const&, Precision>))
constexpr S uni20::scalar_at_precision (V const &value, Precision p)
 Construct or convert a scalar at one explicit precision.
 

Variables

template<typename T >
constexpr bool uni20::has_runtime_precision_v = false
 Whether numerical values of this scalar family carry runtime precision.