IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
Internal Detail Types

Internal types and implementation details with limited public exposure. More...

Namespaces

namespace  peak::common::detail
 Namespace for internal implementation details and low-level types.

Classes

class  peak::common::detail::PointXd< T, dimension >
 A point in space with configurable dimensionality and coordinate type. More...
class  peak::common::detail::PointT< T >
 2D point template type. More...
class  peak::common::detail::RectangleT< PointType, SizeType >
 A generic rectangle defined by a point and a size. More...
class  peak::common::detail::SizeT< T >
 Represents a two-dimensional size with non-negative width and height. More...
class  peak::common::detail::IntervalT< T >
 Represents a continuous numeric interval with inclusive lower and upper bounds. More...
class  peak::common::detail::RangeT< T >
 Represents a numeric range with defined boundaries and a fixed increment. More...

Functions

template<typename H>
constexpr bool peak::common::detail::AreAlmostEqual (H lhs, H rhs, uint32_t ulp)
 Compares two floating-point values for approximate equality using a ULP-based tolerance.

Detailed Description

Internal types and implementation details with limited public exposure.

This module contains internal types, helper classes, and low-level implementation details that are primarily intended for internal use within the library. These types are located in the detail namespace and are not part of the stable public API.

Direct use of types from the detail namespace is discouraged, as their structure and behavior may change without notice between versions.

When needed, stable access to certain internal types is provided through public using declarations or type aliases. These public aliases form part of the supported API surface and are safe to use. Only these publicly exposed aliases should be relied upon in user code.

Since
ids_peak_common 1.0

Function Documentation

◆ AreAlmostEqual()

template<typename H>
bool peak::common::detail::AreAlmostEqual ( H lhs,
H rhs,
uint32_t ulp )
constexpr

Compares two floating-point values for approximate equality using a ULP-based tolerance.

Determines whether two floating-point numbers are approximately equal by considering the difference between them relative to their magnitude and the machine epsilon. The comparison uses a configurable tolerance based on Units in the Last Place (ULP).

Parameters
lhsThe first floating-point value to compare.
rhsThe second floating-point value to compare.
ulpThe tolerance multiplier in ULP units; larger values allow for greater difference.
Returns
True if the two values are approximately equal within the specified ULP tolerance; false otherwise.

This function is useful for mitigating issues with precision loss in floating-point arithmetic, especially when exact equality comparisons are not reliable.

Since
ids_peak_common 1.0