22 using U = std::conditional_t<std::is_same_v<T, float>, std::uint32_t, std::uint64_t>;
23 using S = std::make_signed_t<U>;
24 return U( U( S(
bit_cast<U>( x ) ) >> ( 8 *
sizeof( U ) - 1 ) ) | 1 );
32 constexpr U absMask = U( -1 ) >> 1;
43 if constexpr ( std::is_same_v<T, float> || std::is_same_v<T, double> )
49 return std::nextafter( x, std::numeric_limits<T>::max() );
57 if constexpr ( std::is_same_v<T, float> || std::is_same_v<T, double> )
62 return std::nextafter( x, std::numeric_limits<T>::lowest() );
T nextUp(T x)
Definition MRNextUpDown.h:41
auto signStep(T x)
+1 for positive x and -1 (all bits set) for negative x, as an unsigned integer of the same size as x
Definition MRNextUpDown.h:20
bool nonzeroBelowMax(T x)
whether 0 < |x| < max: then the closest values around x differ from it by one in the bits; one unsign...
Definition MRNextUpDown.h:29
T nextDown(T x)
Definition MRNextUpDown.h:55
constexpr To bit_cast(const From &from) noexcept
std::bit_cast wrapper with the compiler's intrinsic fallback
Definition MRBitCast.h:17
for internal use: namespace detail is not bound to other languages
Definition MRAllocator.h:23
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8