Math-Rational-Approx
view release on metacpan or search on metacpan
* Makefile.PL:
MooX::Types::MooseLike::Numeric was split off from
MooX::Types::MooseLike, so require that instead
2013-04-10 23:08 -0400 djerius <djerius@cfa.harvard.edu> (2ee66d1650a4)
* lib/Math/Rational/Approx/MaxD.pm:
Moo no longer allows similarly named attributes and methods
bounds method originally returned a copy of the bounds attribute so
that the caller wouldn't corrupt the iterations. instead, use the
default accessor and trust the caller.
2012-09-27 10:04 -0400 Diab Jerius <djerius@cfa.harvard.edu> (17b7bd0ad171)
* .hgtags: new file.
* .hgtags:
Added tag 0.01 for changeset afe91a595a34
2012-09-27 10:04 -0400 Diab Jerius <djerius@cfa.harvard.edu> (afe91a595a34 [0.01])
($n, $d, $bounds ) = maxD( $x, 10 );
# refine; note reuse of $bounds from previous call
( $n, $d ) = maxD( $x, 20, $bounds );
#
# find rational approximation to arbitrary precision using
# continued fractions
# one shot, 10 iterations
( $numerator, $denominator ) =
contfrac_nd( contfrac( 1.234871035, 10 ) );
# multiple calls on same number; useful for convergence tests
# keep array containing terms; get fraction and perhaps test it
( $terms, $residual ) = contfrac( 1.234871035, 3 );
( $n, $d ) = contfrac_nd( $terms );
# continue for an additional number of steps; note reuse of $terms;
# new terms are appended to it
lib/Math/Rational/Approx.pm view on Meta::CPAN
($n, $d, $bounds ) = maxD( $x, 10 );
# refine; note reuse of $bounds from previous call
( $n, $d ) = maxD( $x, 20, $bounds );
#
# find rational approximation to arbitrary precision using
# continued fractions
# one shot, 10 iterations
( $numerator, $denominator ) =
contfrac_nd( contfrac( 1.234871035, 10 ) );
# multiple calls on same number; useful for convergence tests
# keep array containing terms; get fraction and perhaps test it
( $terms, $residual ) = contfrac( 1.234871035, 3 );
( $n, $d ) = contfrac_nd( $terms );
# continue for an additional number of steps; note reuse of $terms;
# new terms are appended to it
( run in 1.740 second using v1.01-cache-2.11-cpan-71847e10f99 )