shedAggregateNoise.php
Table of Contents
Functions
- shedAggregateNoise() : object|array<string, mixed>
- Sheds the float noise of the summed aggregates of one grouped row.
Functions
shedAggregateNoise()
Sheds the float noise of the summed aggregates of one grouped row.
shedAggregateNoise(object|array<string, mixed> $row, array<int, string> $names) : object|array<string, mixed>
A COLLECT row is not a document : it comes back raw, and the SUM and
AVERAGE the store computed carry the binary noise of an addition of floats —
1380913.4299999992 where the sheets hold cents. The named keys are cleaned by
shedFloatNoise(), whose scale follows the size of the figure ; a value that
is not a float — an integer sum, a count, a null, a dimension — is left as it is,
and so is every key that is not named.
Parameters
- $row : object|array<string, mixed>
-
The grouped row, as the store handed it back.
- $names : array<int, string>
-
The keys of the aggregates that add up.
Tags
Return values
object|array<string, mixed> —The row, in the shape it came in.