// =====================================================================================================================
//  fennec, a free and open source game engine
//  Copyright © 2025 - 2026  Medusa Slockbower
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================

///
/// \file fennec/lang/float.h
/// \brief metaprogramming floating point type info
///
///
/// \details This file is automatically generated for the current build environment.
///
/// Environment for this build: Clang Linux x86_64
///
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///

#ifndef FENNEC_LANG_FLOAT_H
#define FENNEC_LANG_FLOAT_H

#include <fennec/lang/bits.h>

#undef FLT_HAS_INFINITY
#undef FLT_HAS_QUIET_NAN
#undef FLT_HAS_SIGNALING_NAN
#undef FLT_HAS_DENORM
#undef FLT_HAS_DENORM_LOSS
#undef FLT_ROUNDS
#undef FLT_IS_IEC559
#undef FLT_MANT_DIG
#undef FLT_DIG
#undef FLT_DECIMAL_DIG
#undef FLT_RADIX
#undef FLT_MIN_EXP
#undef FLT_MAX_EXP
#undef FLT_MIN_10_EXP
#undef FLT_MAX_10_EXP
#undef FLT_TRAPS
#undef FLT_TINYNESS_BEFORE
#undef FLT_MIN
#undef FLT_MAX
#undef FLT_EPSILON
#undef FLT_INF
#undef FLT_QUIET_NAN
#undef FLT_SIGNALING_NAN
#undef FLT_DENORM_MIN
#undef FLT_ROUND_ERR

/// \brief Does \emph{float} have an infinity?
#define FLT_HAS_INFINITY 1
/// \brief Does \emph{float} have a quiet NaN?
#define FLT_HAS_QUIET_NAN 1
/// \brief Does \emph{float} have a signaling NaN?
#define FLT_HAS_SIGNALING_NAN 1
/// \brief Does \emph{float} use denormalization?
#define FLT_HAS_DENORM 1
/// \brief Does \emph{float} have loss with denormalization?
#define FLT_HAS_DENORM_LOSS 0
/// \brief What rounding style does \emph{float} use?
#define FLT_ROUNDS 1
/// \brief Does \emph{float} use the IEEE floating point specification?
#define FLT_IS_IEC559 1
/// \brief The number of mantissa bits in \emph{float}.
#define FLT_MANT_DIG 24
/// \brief The number of decimal digits guaranteed to be preserved in a \emph{float} &rarr; \emph{text} &rarr; \emph{float}.
#define FLT_DIG 6
/// \brief The decimal precision required to serialize and deserialize a \emph{float}.
#define FLT_DECIMAL_DIG 9
/// \brief The radix, or integer base, used to represent a \emph{float}.
#define FLT_RADIX 2
/// \brief The minimum negative integer such that \math{\textbf{FLT_RADIX}^\textbf{FLT_MIN_EXP}} results in a normalized \emph{float}.
#define FLT_MIN_EXP -125
/// \brief The maximum positive integer such that \math{\textbf{FLT_RADIX}^\textbf{FLT_MAX_EXP}} results in a non-infinite \emph{float}.
#define FLT_MAX_EXP 128
/// \brief The minimum negative integer such that \math{{10}^\textbf{FLT_MIN_EXP}} results in a normalized \emph{float}.
#define FLT_MIN_10_EXP -37
/// \brief The maximum positive integer such that \math{{10}^\textbf{FLT_MAX_EXP}} results in a non-infinite \emph{float}.
#define FLT_MAX_10_EXP 38
/// \brief Do arithmetics operations with \emph{float} trap?
#define FLT_TRAPS 0
/// \brief Do arithmetics operations with \emph{float} check for underflow?
#define FLT_TINYNESS_BEFORE 0
/// \brief Smallest positive, finite, normal value of \emph{float}.
#define FLT_MIN fennec::bit_cast<float>(0x800000)
/// \brief Largest positive, finite value of \emph{float}.
#define FLT_MAX fennec::bit_cast<float>(0x7f7fffff)
/// \brief The difference between \emph{1.0} and the next representable value of \emph{float}.
#define FLT_EPSILON fennec::bit_cast<float>(0x34000000)
/// \brief A value representing \emph{\inf} of type \emph{float}.
#define FLT_INF fennec::bit_cast<float>(0x7f800000)
/// \brief A value representing \emph{NaN} of type \emph{float} that does not trap.
#define FLT_QUIET_NAN fennec::bit_cast<float>(0x7fc00000)
/// \brief A value representing \emph{NaN} of type \emph{float} that traps.
#define FLT_SIGNALING_NAN fennec::bit_cast<float>(0x7fa00000)
/// \brief Smallest positive, finite, subnormal value of \emph{float}.
#define FLT_DENORM_MIN fennec::bit_cast<float>(0x1)
/// \brief Maximum rounding error of type \emph{float}.
#define FLT_ROUND_ERR fennec::bit_cast<float>(0x3f000000)

#undef DBL_HAS_INFINITY
#undef DBL_HAS_QUIET_NAN
#undef DBL_HAS_SIGNALING_NAN
#undef DBL_HAS_DENORM
#undef DBL_HAS_DENORM_LOSS
#undef DBL_ROUNDS
#undef DBL_IS_IEC559
#undef DBL_MANT_DIG
#undef DBL_DIG
#undef DBL_DECIMAL_DIG
#undef DBL_RADIX
#undef DBL_MIN_EXP
#undef DBL_MAX_EXP
#undef DBL_MIN_10_EXP
#undef DBL_MAX_10_EXP
#undef DBL_TRAPS
#undef DBL_TINYNESS_BEFORE
#undef DBL_MIN
#undef DBL_MAX
#undef DBL_EPSILON
#undef DBL_INF
#undef DBL_QUIET_NAN
#undef DBL_SIGNALING_NAN
#undef DBL_DENORM_MIN
#undef DBL_ROUND_ERR

/// \brief Does \emph{double} have an infinity?
#define DBL_HAS_INFINITY 1
/// \brief Does \emph{double} have a quiet NaN?
#define DBL_HAS_QUIET_NAN 1
/// \brief Does \emph{double} have a signaling NaN?
#define DBL_HAS_SIGNALING_NAN 1
/// \brief Does \emph{double} use denormalization?
#define DBL_HAS_DENORM 1
/// \brief Does \emph{double} have loss with denormalization?
#define DBL_HAS_DENORM_LOSS 0
/// \brief What rounding style does \emph{double} use?
#define DBL_ROUNDS 1
/// \brief Does \emph{double} use the IEEE doubleing point specification?
#define DBL_IS_IEC559 1
/// \brief The number of mantissa bits in \emph{double}.
#define DBL_MANT_DIG 53
/// \brief The number of decimal digits guaranteed to be preserved in a \emph{double} &rarr; \emph{text} &rarr; \emph{double}.
#define DBL_DIG 15
/// \brief The decimal precision required to serialize and deserialize a \emph{double}.
#define DBL_DECIMAL_DIG 17
/// \brief The radix, or integer base, used to represent a \emph{double}.
#define DBL_RADIX 2
/// \brief The minimum negative integer such that \math{\textbf{DBL_RADIX}^\textbf{DBL_MIN_EXP}} results in a normalized \emph{double}.
#define DBL_MIN_EXP -1021
/// \brief The maximum positive integer such that \math{\textbf{DBL_RADIX}^\textbf{DBL_MAX_EXP}} results in a non-infinite \emph{double}.
#define DBL_MAX_EXP 1024
/// \brief The minimum negative integer such that \math{{10}^\textbf{DBL_MIN_EXP}} results in a normalized \emph{double}.
#define DBL_MIN_10_EXP -307
/// \brief The maximum positive integer such that \math{{10}^\textbf{DBL_MAX_EXP}} results in a non-infinite \emph{double}.
#define DBL_MAX_10_EXP 308
/// \brief Do arithmetics operations with \emph{double} trap?
#define DBL_TRAPS 0
/// \brief Do arithmetics operations with \emph{double} check for underflow?
#define DBL_TINYNESS_BEFORE 0
/// \brief Smallest positive, finite, normal value of \emph{double}.
#define DBL_MIN fennec::bit_cast<double>(0x10000000000000ll)
/// \brief Largest positive, finite value of \emph{double}.
#define DBL_MAX fennec::bit_cast<double>(0x7fefffffffffffffll)
/// \brief The difference between \emph{1.0} and the next representable value of \emph{double}.
#define DBL_EPSILON fennec::bit_cast<double>(0x3cb0000000000000ll)
/// \brief A value representing \emph{\inf} of type \emph{double}.
#define DBL_INF fennec::bit_cast<double>(0x7ff0000000000000ll)
/// \brief A value representing \emph{NaN} of type \emph{double} that does not trap.
#define DBL_QUIET_NAN fennec::bit_cast<double>(0x7ff8000000000000ll)
/// \brief A value representing \emph{NaN} of type \emph{double} that traps.
#define DBL_SIGNALING_NAN fennec::bit_cast<double>(0x7ff4000000000000ll)
/// \brief Smallest positive, finite, subnormal value of \emph{double}.
#define DBL_DENORM_MIN fennec::bit_cast<double>(0x1ll)
/// \brief Maximum rounding error of type \emph{double}.
#define DBL_ROUND_ERR fennec::bit_cast<double>(0x3fe0000000000000ll)

#endif // FENNEC_LANG_FLOAT_H
