On 15/08/15 18:45, Nathann Cohen wrote:
What functions return for example python double?

The MixedIntegerLinearProgram code, for instance. And probably many
others. Either way, if you want to prevent functions from returning
'int', I don't get why you would allow float/double. That would be
very surprising.

For example
centrality_degree on graphs return Sage rational, not machine float.

Not only. I was forced to implement a Rational version of that because
the reviewer would not accept a function that returns float. But the
Rational version is mostly useless, given that it is way way way
slower than the other one (and that I wrote that only to be faster
than other libraries on some benchmarks)

You are not fair. You changed the specification of the function from returning rationals to floats. And then, I complained that rationals are exact and the function was not taking care of error propagation when doing floating point operations. Sometimes you claim that truthness is more important (remember the def hash: return 0) and sometimes you claim that speed is better (as here).

That being said, any function of the form

cpdef long f():
   cdef long res
   .. operations ..
   return res

will return an int in Python because this is how Cython works. Similarly with C double and Python float. We do not want to change that.

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to