expr = (Rational(-1, 2) * Z * k * (e**2) / r)
>>> expr
2
-Z⋅e ⋅k
────────
2⋅r
>>> ccode(expr)
-1.0/2.0*Z*pow(e, 2)*k/r
>>> from sympy.codegen.ast import real, float80
>>> ccode(expr, assign_to="E", type_aliases={real: float80})
E = -1.0L/2.0L*Z*powl(e, 2)*k/r;