-
round_to_sum — Round a list of numbers such that their sum is the rounded sum.
You are reading Qoolqit v0.4.0, an older version of this documentation. Go to the latest version (v1.5.0)
qoolqit.waveforms.utils
module
qoolqit.waveforms.utils
Functions
round_to_sum (values: list[float]) → list[int]
Round a list of numbers such that their sum is the rounded sum.
Σᵢround(aᵢ) = round(Σᵢaᵢ)
Example
>>> round_to_sum([100.3, 100.3, 100.4])>>> [100, 100, 101]