/* This version seems to have a better chance, but still can't quite manage it */ #include "library.h" double sum(const int from, const int to) { if (from <= to) { const double s = from*from - 10*from + 23; if (s < 0) { print("Error - square root of negative: "); print(s); print(" when i = "); print(from); new_line(); return -1; } return sqrt(s) + sum(from + 1, to); } else return 0; } void main() { print(sum(0, 10)); new_line(); }