Commit f1683788 authored by Travis Hance's avatar Travis Hance Committed by Travis Hance

fixes from kmod's code review

parent 8e952a4e
...@@ -163,6 +163,9 @@ def convert(n, f): ...@@ -163,6 +163,9 @@ def convert(n, f):
elif isinstance(v, float): elif isinstance(v, float):
f.write(struct.pack(">d", v)) f.write(struct.pack(">d", v))
elif isinstance(v, complex): elif isinstance(v, complex):
# Complex constants can only be pure imaginary
# (e.g., in 1+0j, 1 and 0j are separate literals)
assert v.real == 0.0
f.write(struct.pack(">d", v.imag)) f.write(struct.pack(">d", v.imag))
elif v is None or isinstance(v, _ast.AST): elif v is None or isinstance(v, _ast.AST):
convert(v, f) convert(v, f)
......
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
namespace pyston { namespace pyston {
extern "C" Box* createPureImaginary(double i); extern "C" Box* createPureImaginary(double i);
extern "C" double mod_complex_complex(double lhs, double rhs);
extern "C" double div_complex_complex(double lhs, double rhs);
extern "C" double floordiv_complex_complex(double lhs, double rhs);
extern "C" double pow_complex_complex(double lhs, double rhs);
} }
#endif #endif
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