Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type > Struct Template Reference

#include <clamped_math_impl.h>

Public Types

using result_type = typename MaxExponentPromotion< T, U >::type
 

Static Public Member Functions

template<typename V = result_type>
static constexpr V Do (T x, U y)
 

Detailed Description

template<typename T, typename U>
struct base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >

Definition at line 151 of file clamped_math_impl.h.

Member Typedef Documentation

◆ result_type

template<typename T , typename U >
using base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::result_type = typename MaxExponentPromotion<T, U>::type

Definition at line 155 of file clamped_math_impl.h.

Member Function Documentation

◆ Do()

template<typename T , typename U >
template<typename V = result_type>
static constexpr V base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do ( T  x,
y 
)
inlinestaticconstexpr

Definition at line 157 of file clamped_math_impl.h.

157 {
158 V result = {};
159 if (BASE_NUMERICS_LIKELY((CheckedDivOp<T, U>::Do(x, y, &result))))
160 return result;
161 // Saturation goes to max, min, or NaN (if x is zero).
162 return x ? CommonMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y))
163 : SaturationDefaultLimits<V>::NaN();
164 }
GAsyncResult * result
T __attribute__((ext_vector_type(N))) V
double y
double x
constexpr bool IsValueNegative(T value)
#define BASE_NUMERICS_LIKELY(x)

The documentation for this struct was generated from the following file: