What's up with the abs() function :D?

accDifference is an array of floats and differencesum is a float - so it shouldn’t be typecasting anything ?

float accDifference[3];

unsigned long Now = millis(); // Used to compare to last punch

// check to see if there is a previous value before calculating differences
if(on == false){
    for(int i = 0; i < 3; i++){
        prev[i] = array[i];
        on = true;
    }
}

else if(Now - lastPunch > punch_delay) {
    
    for(int i = 0; i < 3; i++){
        
        float difference = array[i]-prev[i];
        accDifference[i] = abs(difference);
        differenceSum += accDifference[i];
           
        prev[i] = array[i];
       
    }
    
filterSignal(accDifference);

}

}