MathAbs

Fonksiyon, belirtilen sayısal değerin mutlak değerine dönüş yapar.

double  MathAbs(
   double  value      // sayısal değer
   );

Parametreler

value

[in]  Nümerik değer.

Dönüş değeri

Sıfıra eşit veya sıfırdan büyük double tipli değer.

Not

MathAbs() fonksiyonu yerine fabs() kullanabilirsiniz.

 

Örnek:

//--- girdi parametreleri
input int      InpValue = -10;   // Buraya herhangi bir değer girin
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- girdi olarak girilen sayının mutlak değerini al
   uint abs_value=MathAbs(InpValue);
//--- değerleri günlüğe yazdır
   PrintFormat("The entered value %d received the value %u after using the MathAbs() function",InpValue,abs_value);
  }