Expansions

NAME

Math::NumberTheory::Expansions

SYNOPSIS

use Math::NumberTheory::Expansions;
say number-expansion(pi, t => "Engel", :10n);                        # β†’ [1, 1, 1, 8, ...]
    say number-expansion(3/19, type => "Sylvester");                     # β†’ [7, 67]
    say number-expansion(384, "Cantor");                                 # β†’ [0, 0, 0, 1, 3]
    say number-expansion(pi, t => "CantorProduct", :5number-of-terms);   # β†’ [1, 2, 22, 600, ...]
    say number-expansion(5/13, "Lueroth");                               # β†’ [3, [3,4,2]]  (periodic)
say from-number-expansion([2, 7, 3, 2, 2, 2, 2, 2], 'lueroth');      # approx. reconstruction
    say from-number-expansion([1,1,1,8,8], type => "Engel");             # approx. reconstruction
    say from-number-expansion((1, 0, 1, 0, 1, 0, 1), 'Zeckendorf');      # exact reconstruction (33)

Math::NumberTheory v0.1.4

Raku package for number theory functions.

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Math::NumberTheory
  • Math::NumberTheory::Constants
  • Math::NumberTheory::ContinuedFraction
  • Math::NumberTheory::Expansions
  • Math::NumberTheory::Fibonacci
  • Math::NumberTheory::Utilities

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite β€” the markup and publishing tools behind this site.