Releases: neilkichler/cuinterval
Version 0.3.0
Changes
QOL
Adds many quality of life overloads that were missing before. Including:
- pow with floating-point exponent
- floating-point <
+,-,*,/> interval and vice versa - integer <
+,-,*,/> interval and vice versa - added
isnan, behaving equivalently toisnai - improved overloading behavior when combined with other libraries (e.g., CuTangent, CuMcCormick)
Numeric limits
The std::numeric_limits may be overloaded for custom data types. For cu::interval, it should behave like the underlying type.
E.g.,
std::numeric_limits<double>::epsilon() == std::numeric_limits<cu::interval<double>>::epsilon()
As per the standard, overloading this class for our custom data type is valid.
No formatting by default
By default we do not include the formatting specializations (for std::ostream, std::format, etc.) to allow seamless use of custom
printing behavior. If the default behavior is wanted, simply include #include <cuinterval/format.h> to get it.
Full Changelog: v0.2.1...v0.3.0
Version 0.2.1
Changes
- Fix log implementations not using the intersected variables. This may have caused incorrect results when the interval contained out of domain values. In particular, below 0 as a lower bound but a valid upper bound.
- Added icpx preset in CMakePresets.json
- Documentation fixes.
Full Changelog: v0.2.0...v0.2.1
Version 0.2.0
Full Changelog: v0.1.0...v0.2.0
Added std::numbers and std::format overloads for cu::interval.
std::numbers support:
It is allowed by the standard to overload the numbers (pi, e, ln2, etc.) and is now possible to do for cu::interval.
Just use, e.g., std::numbers::pi_v<cu::interval<double>> to get the smallest interval that still contains the real
pi value. This will not just be a point interval with std::numbers::pi_v because pi (and all the other numbers
in std::numbers) cannot be represented in IEEE-754 floating-point numbers.
The same numbers are also accessible from within the cu:: namespace.
std::format support:
Now supports using std::format with the cu::interval type. For example,
std::format("interval: {}", cu::interval<double>{1.0, 2.0});prints: interval: [1, 2].
All the format specifiers that the underlying type T of cu::interval supports are also supported for cu::interval.
For example,
std::format("interval: {:.4f}", cu::interval<double>{1.0, 2.0});prints: interval: [1.0000, 2.0000].
Version 0.1.0
v0.1.0 update git tag in FetchContent example