Kevin Ryde > Math-NumSeq-63 > Math::NumSeq::AllDigits

Math-NumSeq-63.tar.gz

Dependencies

Annotate this POD

Website

# CPAN RT

 Open 0
View/Report Bugs
Module Version: 63   Source   Latest Release: Math-NumSeq-69

# NAME

Math::NumSeq::AllDigits -- digits of the integers

# SYNOPSIS

``` use Math::NumSeq::AllDigits;
my \$seq = Math::NumSeq::AllDigits->new;
my (\$i, \$value) = \$seq->next;```

# DESCRIPTION

This sequence is the digits of the integers 0, 1, 2, etc,

```    0,1,2,3,4,5,6,7,8,9, 1,0, 1,1, 1,2, 1,3, 1,4, 1,5, 1,6,...
starting i=0```

The default is decimal, or the `radix` parameter can select another base.

The optional `order` parameter (a string) can control the order of the digits of each integer,

```    "forward"      high to low, 3512 -> 3,5,1,2
"reverse"      low to high, 3512 -> 2,1,5,3
"sorted"       sorted, 3512 -> 1,2,3,5```

# FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

`\$seq = Math::NumSeq::Digit->new ()`
`\$seq = Math::NumSeq::Digit->new (radix => \$radix, order => \$str)`

Create and return a new sequence object.

## Random Access

`\$value = \$seq->ith(\$i)`

Return the `\$i`'th value from the sequence.

`\$bool = \$seq->pred(\$value)`

Return true if `\$value` occurs in the sequence, which simply means digits 0 to radix-1.

http://user42.tuxfamily.org/math-numseq/index.html