Number::Closest - find number(s) closest to a number in a list of numbers


Number-Closest documentation  | view source Contained in the Number-Closest distribution.

Index


NAME

Top

Number::Closest - find number(s) closest to a number in a list of numbers

SYNOPSIS

Top

 use Number::Closest;

 my $finder = Number::Closest->new(number => $num, numbers => \@num) ;
 my $closest = $finder->find; # finds closest number
 my $closest_two = $finder->find(2) ;  # gives arrayref of two closest numbers in list

 # or, all in one shot
 Number::Closest->new(number => $num, numbers => \@num)->find(1) ;










SEE ALSO

Top

http://stackoverflow.com/questions/445782/finding-closest-match-in-collection-of-numbers

AUTHOR

Top

Terrence Brannon, <tbone at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-number-closest at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Number-Closest. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Number::Closest




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Number-Closest

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Number-Closest

* CPAN Ratings

http://cpanratings.perl.org/d/Number-Closest

* Search CPAN

http://search.cpan.org/dist/Number-Closest/

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Number-Closest documentation  | view source Contained in the Number-Closest distribution.