Generated by Cython 0.17pre on Wed Oct 10 09:42:39 2012
Raw output: _mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.c
1:
2: include "interrupt.pxi" # ctrl-c interrupt block support
3: include "stdsage.pxi" # ctrl-c interrupt block support
4:
5: include "cdefs.pxi"
6: def cython_sum(long n):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":6 * * include "cdefs.pxi" * def cython_sum(long n): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long long i, s = 0 * for i in range(1, n+1): */ static PyObject *__pyx_pf_60_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0_cython_sum(CYTHON_UNUSED PyObject *__pyx_self, long __pyx_v_n) { PY_LONG_LONG __pyx_v_i; PY_LONG_LONG __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cython_sum", 0); /* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":6 * * include "cdefs.pxi" * def cython_sum(long n): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long long i, s = 0 * for i in range(1, n+1): */ __pyx_k_tuple_2 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_2); __Pyx_INCREF(((PyObject *)__pyx_n_s__n)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_n_s__n)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__n)); __Pyx_INCREF(((PyObject *)__pyx_n_s__n)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 1, ((PyObject *)__pyx_n_s__n)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__n)); __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 2, ((PyObject *)__pyx_n_s__i)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); __Pyx_INCREF(((PyObject *)__pyx_n_s__s)); PyTuple_SET_ITEM(__pyx_k_tuple_2, 3, ((PyObject *)__pyx_n_s__s)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__s)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); /* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":6 * * include "cdefs.pxi" * def cython_sum(long n): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long long i, s = 0 * for i in range(1, n+1): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_60_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0_1cython_sum, NULL, __pyx_n_s_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cython_sum, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7: cdef long long i, s = 0
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":7 * include "cdefs.pxi" * def cython_sum(long n): * cdef long long i, s = 0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(1, n+1): * s += i*i */ __pyx_v_s = 0;
8: for i in range(1, n+1):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":8 * def cython_sum(long n): * cdef long long i, s = 0 * for i in range(1, n+1): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* s += i*i * return s */ __pyx_t_1 = (__pyx_v_n + 1); for (__pyx_t_2 = 1; __pyx_t_2<
__pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2;
9: s += i*i
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":9 * cdef long long i, s = 0 * for i in range(1, n+1): * s += i*i #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return s */ __pyx_v_s = (__pyx_v_s + (__pyx_v_i * __pyx_v_i)); }
10: return s
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.pyx":10 * for i in range(1, n+1): * s += i*i * return s #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyLong_FromLongLong(__pyx_v_s); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage91_spyx_0.cython_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }