Skip to content

Commit

Permalink
Use forEach again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexanone committed Jan 16, 2021
1 parent ae87c37 commit 2f38bca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/arrays/fnc_standardDeviation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ private _count = count _numbers;
if (_count <= _ddof) exitWith {0};

private _mean = 0;
{_mean = _mean + _x} count _numbers;
{_mean = _mean + _x} forEach _numbers;
_mean = _mean / _count;

private _resSumSqrs = 0;
{
_resSumSqrs = _resSumSqrs + (_x - _mean)^2;
} count _numbers;
} forEach _numbers;

sqrt (_resSumSqrs / (_count - _ddof)) // return

0 comments on commit 2f38bca

Please sign in to comment.