#17157: Cleanup formula for Bell numbers
-----------------------------+----------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone: sage-6.4
Component: combinatorics | Keywords:
Merged in: | Authors: Jeroen Demeyer
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------
In the function `bell_number`, we have the line
{{{
return ZZ(ceil(N((b - n) / n2 * exp2(Integer(-1)) - 1 / 4, log(b, 2) +
3)))
}}}
This can be improved by
1. Removing the `1 / 4` which is actually `0` in Python 2.
2. Not using global functions like `ceil()` and `exp()`.
3. Using a `RealField` instead of the `N()` function.
--
Ticket URL: <http://trac.sagemath.org/ticket/17157>
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.