import cmath
import math


def tidy(z):
    """Arrondit les deux cases ; le + 0.0 change les -0.0 en 0.0."""
    return complex(round(z.real, 3) + 0.0, round(z.imag, 3) + 0.0)


theta = math.pi / 2
# Sans i, le signe moins fait descendre vers 0
print("exp(-θ)  =", round(math.exp(-theta), 3))
# Avec i, le signe moins fait tourner dans l'autre sens ; la distance à zéro reste 1
print("exp(iθ)  =", tidy(cmath.exp(1j * theta)), "  abs =", round(abs(cmath.exp(1j * theta)), 3))
print("exp(-iθ) =", tidy(cmath.exp(-1j * theta)), "  abs =", round(abs(cmath.exp(-1j * theta)), 3))
