# MathLog Returns the logarithm of a number by base 10. ``` double  MathLog10(    double  val      // number to take logarithm    ); ``` Parameters val [in]  Numeric value the common logarithm of which is to be calculated. Return Value The common logarithm in case of success. If val is negative, the function returns NaN (undetermined value). If val is equal to 0, the function returns INF (infinity). Note Instead of MathLog10() you can use log10(). Example: ``` #define GRAPH_WIDTH  750 #define GRAPH_HEIGHT 350   #include    CGraphic ExtGraph; //+------------------------------------------------------------------+ //| Script program start function                                    | //+------------------------------------------------------------------+ void OnStart()   { //--- get 9 values from 0 to 8 with step 1    vector X(9,VectorArange);    Print("vector X = \n",X); //--- calculate the decimal logarithm for each value of the X vector    X=MathLog10(X);    Print("MathLog10(X) = \n",X);     //--- transfer the calculated values from the vector to the array    double y_array[];    X.Swap(y_array);   //--- draw a graph of the calculated vector values    CurvePlot(y_array,clrDodgerBlue);   //--- wait for pressing the Escape or PgDn keys to delete the graph (take a screenshot) and exit    while(!IsStopped())      {       if(StopKeyPressed())          break;       Sleep(16);      }   //--- clean up    ExtGraph.Destroy();    /*    result:    vector X =     [0,1,2,3,4,5,6,7,8]    MathLog10(X) =     [-inf,0,0.3010299956639812,0.4771212547196624,0.6020599913279624,0.6989700043360189,0.7781512503836436,0.8450980400142568,0.9030899869919435]    */   } //+------------------------------------------------------------------+ //| Fill a vector with 'value' in 'step' increments                  | //+------------------------------------------------------------------+ template  void VectorArange(vector &vec,T value=0.0,T step=1.0)    {     for(ulong i=0; i