1#ifndef SOURCEMETA_CORE_NUMERIC_ERROR_H
2#define SOURCEMETA_CORE_NUMERIC_ERROR_H
4#ifndef SOURCEMETA_CORE_NUMERIC_EXPORT
5#include <sourcemeta/core/numeric_export.h>
11namespace sourcemeta::core {
17#pragma warning(disable : 4251 4275)
24 [[nodiscard]]
auto what()
const noexcept ->
const char *
override {
25 return "Invalid decimal string format";
32 :
public std::exception {
34 [[nodiscard]]
auto what()
const noexcept ->
const char *
override {
35 return "Division by zero";
42 :
public std::exception {
44 [[nodiscard]]
auto what()
const noexcept ->
const char *
override {
45 return "Invalid numeric operation";
52 :
public std::exception {
54 [[nodiscard]]
auto what()
const noexcept ->
const char *
override {
55 return "Numeric overflow";
62class SOURCEMETA_CORE_NUMERIC_EXPORT NumericOutOfRangeError
63 :
public std::out_of_range {
65 NumericOutOfRangeError()
66 : std::out_of_range{
"Numeric value is out of range"} {}
72 :
public std::exception {
74 [[nodiscard]]
auto what()
const noexcept ->
const char *
override {
75 return "Out of memory";
80#pragma warning(default : 4251 4275)