tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
midpoint.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  etl
 

Functions

template<etl::floating_point Float>
constexpr auto midpoint (Float a, Float b) noexcept -> Float
 
template<typename Int>
requires (etl::is_integral_v<Int> and not etl::is_same_v<Int, bool>)
constexpr auto midpoint (Int a, Int b) noexcept -> Int
 Returns half the sum of a + b. If the sum is odd, the result is rounded towards a.
 
template<typename Ptr>
requires etl::is_pointer_v<Ptr>
constexpr auto midpoint (Ptr a, Ptr b) noexcept -> Ptr