TsnTables/Src/Misce.mqh
nique_372 a31959724d cambios
2026-09-20 11:19:11 -05:00

63 lines
2.2 KiB
MQL5

//+------------------------------------------------------------------+
//| Tables.mqh |
//| Copyright 2026, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372 |
//+------------------------------------------------------------------+
#ifndef TSNPARSERIN_CPP_DLL
#property copyright "Copyright 2026, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372"
#property strict
#endif // TSNPARSERIN_CPP_DLL
#ifndef TSNTABES_SRC_TABLES_MQH
#define TSNTABES_SRC_TABLES_MQH
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#ifdef TSNPARSERIN_CPP_DLL // TSNPARSERIN_CPP_DLL
// Tipado para c++
#include <cstdint>
#endif // TSNPARSERIN_CPP_DLL
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
namespace TSN
{
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
union TsnBitInterprete
{
uint32_t uint_value;
uint64_t ulong_value;
int64_t long_value;
double double_value;
float float_value;
};
template <typename TValue>
union TsnValToBytes
{
uint8_t bytes[sizeof(TValue)];
TValue value;
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//#define IsDigit(c) ((c ^ '0') <= 9)
//#define IsNotDigit(c) ((c ^ '0') > 9)
//--- Inf +
#define TSN_DBL_INF_LONG_BITS int64_t(0x7FF0000000000000)
//--- Inf -
#define TSN_DBL_INF_NEG_LONG_BITS int64_t(0xFFF0000000000000)
//--- Nan
#define TSN_DBL_NAN_LONG_BITS int64_t(0x7FFFFFFFFFFFFFFF)
}
//+------------------------------------------------------------------+
#endif // TSNTABES_SRC_TABLES_MQH