Bug: function MathSample() does not generate correct results - page 2

 
Ilyas #:

We made decision to change behavior

New code

Build 3187

behavior still unchanged, the logic in inverted.

//+------------------------------------------------------------------+
//| MathSample                                                       |
//+------------------------------------------------------------------+
//| The function takes a sample of the specified size from the       |
//| elements of the array[] with replacement.                        |
//|                                                                  |
//| Arguments:                                                       |
//| array[]     : Array with double values                           |
//| count       : Number of elements to choose                       |
//| replace     : If true, only unique values are placed to result[] |
//| result[]    : Output array                                       |
//|                                                                  |
//| Return value: true if successful, otherwise false.               |
//+------------------------------------------------------------------+
bool MathSample(const double &array[],const int count,const bool replace,double &result[])
  {
//--- unique values not needed
   if(!replace)
      return MathSample(array,count,result);
 

Build 3191: Bug is resolved.

Thanks.