mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
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:
@ -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)]
|
||||
|
Reference in New Issue
Block a user