Commit 6e54fcfd authored by Damien George's avatar Damien George
Browse files

py: Fix typo printing complex numbers that are purely imaginary.

parent d1e443d0
...@@ -30,7 +30,7 @@ STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void * ...@@ -30,7 +30,7 @@ STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void *
char buf[32]; char buf[32];
if (o->real == 0) { if (o->real == 0) {
format_float(o->imag, buf, sizeof(buf), 'g', 6, '\0'); format_float(o->imag, buf, sizeof(buf), 'g', 6, '\0');
print(env, "%s", buf); print(env, "%sj", buf);
} else { } else {
format_float(o->real, buf, sizeof(buf), 'g', 6, '\0'); format_float(o->real, buf, sizeof(buf), 'g', 6, '\0');
print(env, "(%s+", buf); print(env, "(%s+", buf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment