add

fun add(replica: ReplicaId, value: Double): Patch<DDSketch>

Record value as observed by replica. Returns a Patch carrying the minimal delta — one bucket cell (plus the overflow counter when the value clamps). The receiver is unchanged; apply with piece: sketch = sketch.piece(sketch.add(replica, v)).

Because each cell is a GCounter slot owned by replica, a re-delivered patch is absorbed idempotently — counts never inflate under duplication. As with GCounter, two peers must never share a ReplicaId.

Throws

if value is NaN or infinite.