2026-09-15 10:42:00 -04:00
|
|
|
#include "serif/utils/misc/finite.hpp"
|
2026-09-19 07:35:57 -04:00
|
|
|
#include "serif/utils/error/codes.hpp"
|
2026-09-15 10:42:00 -04:00
|
|
|
#include <limits>
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
class test_exception : public std::runtime_error {
|
|
|
|
|
public:
|
2026-09-19 07:35:57 -04:00
|
|
|
test_exception(const std::string& message)
|
|
|
|
|
: std::runtime_error(message) {}
|
2026-09-15 10:42:00 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
double a = std::numeric_limits<double>::infinity();
|
|
|
|
|
|
2026-09-19 07:35:57 -04:00
|
|
|
serif::utils::misc::validate_finite<test_exception, serif::utils::errors::SERiFErrorCode::NON_FINITE_VALUE_ERROR>(a);
|
2026-09-15 10:42:00 -04:00
|
|
|
}
|