Standard deviation is the square root of variance. It measures the typical magnitude of values’ deviations from their mean and provides a statistical primitive for working with arrays of Double values. section 6.1
The calculation builds incrementally: sum supports mean, mean supports variance, and variance supports standard deviation. For an array, variance averages the squared differences from the mean, then std applies sqrt(). section 6.1
A small Swift calculation
For [600, 470, 170, 430, 300], the calculated variance is 21704 and the standard deviation is 147. The same primitive supports z-scores through (value − mean) / standard deviation. section 6.1
In k-means, standard deviation normalizes each dimension through z-scores so dimensions with larger numerical differences do not dominate distance-based clustering. section 6.2














