Fix doctests and builds in various files (#6233)

* Fix doctest in hamming distance

* add line break

* try to fix quantum_riper_adder

* fix floating point build
This commit is contained in:
John Law
2022-07-06 16:00:05 +08:00
committed by GitHub
parent 89fc7bf0b0
commit 9135a1f411
3 changed files with 9 additions and 4 deletions

View File

@ -19,8 +19,11 @@ def polar_force(
True
>>> math.isclose(force[1], 7.0710678118654755)
True
>>> polar_force(10, 3.14, radian_mode=True)
[-9.999987317275396, 0.01592652916486828]
>>> force = polar_force(10, 3.14, radian_mode=True)
>>> math.isclose(force[0], -9.999987317275396)
True
>>> math.isclose(force[1], 0.01592652916486828)
True
"""
if radian_mode:
return [magnitude * cos(angle), magnitude * sin(angle)]