| 208 | return s; |
| 209 | } |
| 210 | String *std(String *s, ha_rows rows) |
| 211 | { |
| 212 | double tmp = ulonglong2double(rows); |
| 213 | if (!(tmp - nulls)) |
| 214 | s->set_real((double) 0.0, 1,my_thd_charset); |
| 215 | else |
| 216 | { |
| 217 | double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) / |
| 218 | (tmp - nulls)); |
| 219 | s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals,my_thd_charset); |
| 220 | } |
| 221 | return s; |
| 222 | } |
| 223 | uint decimals() { return item->decimals; } |
| 224 | friend int collect_real(double *element, element_count count, |
| 225 | TREE_INFO *info); |