# NAME

Math::NumSeq::SqrtDigits -- the digits of a square root

# SYNOPSIS

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

# DESCRIPTION

The sequence of digits which are the square root of a given radicand. For example sqrt(2) in decimal 1, 4, 1, 4, 2, 1, etc, being 1.41421 etc.

The default is decimal, or a `radix` can be given. In the current code `Math::BigInt` is used. (For radix 2, 8 and 10 the specific digit conversion methods in BigInt are used, which might be faster than the general case.)

# FUNCTIONS

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

`\$seq = Math::NumSeq::SqrtDigits->new (sqrt => \$s)`
`\$seq = Math::NumSeq::SqrtDigits->new (sqrt => \$s, radix => \$r)`

Create and return a new sequence object giving the digits of `sqrt(\$s)`.

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

Return true if `\$value` might occurs as a digit in the square root.

Currently this presumes all digits occur, so simply `\$value >= 0` and `\$value < \$radix`. For a perfect square this might be wrong, for a non-square do all digits in fact occur?

# BUGS

The current code requires `Math::BigInt` `bsqrt()`, which may mean BigInt 1.60 or higher (which comes with Perl 5.8.0 and up).

Norman L. de Forest, "The Square Root of 4 to a Million Places", at Project Gutenberg, http://www.gutenberg.org/ebooks/3651