"Break" and "decimal point" problems

 
        int size=ArraySize(close);
        
        double sum[];
        ArrayResize(sum,size,size);
        ArrayInitialize(sum,EMPTY_VALUE);

        for(int i = 0 ; i<size ; i++)
        {
           sum[i]=close[i]+close[i+1];
           ArrayPrint(sum,Digits()+1);
        }

purpose:Add two adjacent elements of the close array, and the result is each element of the sum array


problem:

1、I wanted the "sum array" to finish adding once, so I used "break," but the program didn't stop.

2、I hope there are more decimal places, such as EURUSD1.09986, which should be 2.199720 after calculation, one more place than before.



 
helloea:

purpose:Add two adjacent elements of the close array, and the result is each element of the sum array


problem:

1、I wanted the "sum array" to finish adding once, so I used "break," but the program didn't stop.

2、I hope there are more decimal places, such as EURUSD1.09986, which should be 2.199720 after calculation, one more place than before.



1. you need to show the relevant code including the break that did not work

2. an addition of two values with fixed amounts of decimal places does not result in a value with more decimal places than before


int size=ArraySize(close);
        
double sum[];
ArrayResize(sum,size-1);

for(int i=0; i<size-1; i++)
  {
   sum[i]=close[i]+close[i+1];
  }
ArrayPrint(sum,_Digits);
Reason: