TsnTables/Src/Misce.mqh

63 lines
2.2 KiB
MQL5

2026-05-16 16:50:33 -05:00
//+------------------------------------------------------------------+
//| Tables.mqh |
//| Copyright 2026, Niquel Mendoza. |
//| https://www.mql5.com/es/users/nique_372 |
//+------------------------------------------------------------------+
2026-08-03 12:14:24 -05:00
#ifndef TSNPARSERIN_CPP_DLL
2026-05-16 16:50:33 -05:00
#property copyright "Copyright 2026, Niquel Mendoza."
#property link "https://www.mql5.com/es/users/nique_372"
#property strict
2026-08-03 12:14:24 -05:00
#endif // TSNPARSERIN_CPP_DLL
2026-05-16 16:50:33 -05:00
#ifndef TSNTABES_SRC_TABLES_MQH
#define TSNTABES_SRC_TABLES_MQH
2026-06-02 21:31:44 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#ifdef TSNPARSERIN_CPP_DLL // TSNPARSERIN_CPP_DLL
2026-08-03 12:14:24 -05:00
// Tipado para c++
#include <cstdint>
#endif // TSNPARSERIN_CPP_DLL
2026-05-16 16:50:33 -05:00
2026-06-02 21:31:44 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
2026-05-16 16:50:33 -05:00
namespace TSN
{
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
union TsnBitInterprete
{
2026-09-18 15:34:21 -05:00
uint32_t uint_value;
uint64_t ulong_value;
int64_t long_value;
double double_value;
2026-09-03 19:55:12 -05:00
float float_value;
};
2026-05-16 16:50:33 -05:00
2026-08-29 12:54:36 -05:00
template <typename TValue>
union TsnValToBytes
{
2026-09-18 15:34:21 -05:00
uint8_t bytes[sizeof(TValue)];
2026-08-29 12:54:36 -05:00
TValue value;
};
2026-06-02 21:31:44 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
2026-09-20 11:19:11 -05:00
//#define IsDigit(c) ((c ^ '0') <= 9)
//#define IsNotDigit(c) ((c ^ '0') > 9)
2026-06-02 21:31:44 -05:00
2026-06-18 20:08:12 -05:00
//--- Inf +
2026-08-03 12:14:24 -05:00
#define TSN_DBL_INF_LONG_BITS int64_t(0x7FF0000000000000)
2026-06-18 20:08:12 -05:00
//--- Inf -
2026-08-03 12:14:24 -05:00
#define TSN_DBL_INF_NEG_LONG_BITS int64_t(0xFFF0000000000000)
2026-06-18 20:08:12 -05:00
//--- Nan
2026-08-03 12:14:24 -05:00
#define TSN_DBL_NAN_LONG_BITS int64_t(0x7FFFFFFFFFFFFFFF)
2026-05-16 16:50:33 -05:00
}
//+------------------------------------------------------------------+
2026-05-19 06:59:37 -05:00
#endif // TSNTABES_SRC_TABLES_MQH