complex complex::parsevalue(str *s) { complex mult; if ((!___bool(s))) { return mcomplex(0.0, 0.0); } mult = mcomplex(1.0, 0.0); if (__eq(s->__getitem__((-1)), new str("j"))) { s = s->__slice__(2, 0, (-1), 0); mult = mcomplex(0.0, 1.0); } if (((new list<str *>(2, new str("+"), new str("-"))))->__contains__(s)) { s = s->__iadd__(new str("1")); } return mult * __float(s); }
double atof(str *s) { return __float(s); }
template<class T> inline complex mcomplex(T t) { complex c; c.real = __float(t); c.imag = 0; return c; }