BigNumberByLeo/Test/Misce.mq5

49 lines
1.5 KiB
MQL5
Raw Permalink Normal View History

2026-08-23 17:38:27 -05:00
//+------------------------------------------------------------------+
//| Misce.mq5 |
//| Copyright 2026, Niquel Mendoza |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "..\\Src\\Base\\Main.mqh"
#include "..\\Src\\Utils\\Main.mqh"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
2026-08-24 09:56:46 -05:00
TSN::BigUInteger integer("1200", 10);
2026-08-23 19:05:20 -05:00
2026-08-23 17:38:27 -05:00
uchar bytes[];
2026-08-23 19:05:20 -05:00
const int t = integer.ToBytesBE(bytes, 2);
2026-08-23 17:38:27 -05:00
ArrayPrint(bytes);
string out = "";
TSN::CNumberUtils::BytesToHexLower(bytes, t, out);
Print(out);
2026-08-23 19:05:20 -05:00
2026-08-23 19:37:22 -05:00
integer = TSN::BigUInteger(bytes, BIGUINTEGER_LOADBYTES_BE);
2026-08-24 09:56:46 -05:00
2026-08-23 19:05:20 -05:00
Print(integer[0]);
2026-08-24 09:56:46 -05:00
Print(integer.Gdc(540));
2026-08-23 17:38:27 -05:00
}
//+------------------------------------------------------------------+
2026-08-23 19:37:22 -05:00
2026-08-24 09:56:46 -05:00
//+------------------------------------------------------------------+