29 lines
1.1 KiB
MQL5
29 lines
1.1 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| MathRound.mq5 |
|
||
|
//| Copyright 2021, MetaQuotes Ltd. |
|
||
|
//| https://www.mql5.com |
|
||
|
//+------------------------------------------------------------------+
|
||
|
|
||
|
#define PRT(A) Print(#A, "=", (A))
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Script program start function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnStart()
|
||
|
{
|
||
|
PRT((MathRound(5.5))); // 6.0
|
||
|
PRT((MathRound(-5.5))); // -6.0
|
||
|
PRT((MathCeil(5.5))); // 6.0
|
||
|
PRT((MathCeil(-5.5))); // -5.0
|
||
|
PRT((MathFloor(5.5))); // 5.0
|
||
|
PRT((MathFloor(-5.5))); // -6.0
|
||
|
|
||
|
PRT((MathRound(11))); // 11.0
|
||
|
PRT((MathRound(-11))); // -11.0
|
||
|
PRT((MathCeil(11))); // 11.0
|
||
|
PRT((MathCeil(-11))); // -11.0
|
||
|
PRT((MathFloor(11))); // 11.0
|
||
|
PRT((MathFloor(-11))); // -11.0
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|