stdMIDRANGE function
Expression function MIDRANGE(...): average of the largest and smallest value.
Implementation
dynamic stdMIDRANGE(List<dynamic> values) {
if (values.isEmpty) return 0.0;
final nums = values.map(varToDouble).toList();
final lo = nums.reduce((a, b) => a < b ? a : b);
final hi = nums.reduce((a, b) => a > b ? a : b);
return (lo + hi) / 2.0;
}