Skip to content

Results are limited to Qoolqit v0.4.0

Product news
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 — Round a list of numbers such that their sum is the rounded sum.

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]