#16424: is_triangular_number() speed up
-------------------------------------+-------------------------------------
Reporter: rws | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-6.3
Component: quadratic forms | Resolution:
Keywords: | Merged in:
Authors: Ralf Stephan | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/rws/is_triangular_number___speed_up|
de05b593cb8497493ce92e742a7379bdc8bf8489
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Hi Ralf,
see my branch at public/16424
I rewrote the function as it can be done in a much cleaner/faster way.
Moreover, a function called `is_X` must return a boolean. It makes no
sense to have it return boolean or integer values. I decided to add an
extra argument `return_value` that does the job. I also rewrite the doc
which was very ugly.
Tell me what you think...
Anyway, I am not sure it is worth it to have a function which is just
equivalent to
{{{
is_triangular = lambda n: (8*n+1).is_square()
}}}
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16424#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.