Math::Coprimes - Calculate if two or more numbers are coprimes (relatively primes)
use Math::Coprimes; my $numbers = Math::Coprimes->new(-6, 6, 8); print "They are coprimes!\n" unless $numbers->are_coprimes == 0;
| From Wikipedia: | |
| In mathematics, the integers a and b are said to be coprime or relatively | |
| prime if they have no common factor other than 1 and −1, or equivalently, | |
| if their greatest common divisor is 1. |
For example, 6 and 35 are coprime, but 6 and 27 are not because they are
both divisible by 3. The number 1 is coprime to every integer; 0 is coprime
only to 1 and −1.
List::Util
This is my first package written ever. I welcome any possible feedback.
There might be bugs when using negative integers. I promise to take a look soon.
David Moreno Garza, <damog@ciencias.unam.mx
Thanks to Raquel for being my day to day inspiration. Thanks to the Science Faculty at UNAM for providing such a beautiful career. And thanks also go to some other people that challenged me (even if they don't know) to do this like Tato, Gunnar and bureado: I love those bastards. Thanks also to the #perl dudes.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2007 David Moreno Garza
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.