Horner rule for evaluating a polynomial from an array of coefficients:
This algorithm is pretty efficient and needs no data tables kept.sub bytearray_to_bigint { my $result = Math::BigInt->new('0'); while (@_) { $result <<= 8; # was *= 256; $result += pop; } $result; }
After Compline,
Zaxo
In reply to Horner Rule Re: Converting an array of bytes into a BigInt
by Zaxo
in thread Converting an array of bytes into a BigInt - speed considerations
by dempa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |