factor, from GNU coreutils or BSD Games

Опубликовано: 18 Апрель 2014
на канале: Archived Yu-Jie Lin
624
1

factor prints factors of numbers. I found there are two packages provide nearly the same, one from GNU coreutils [1] and another source is BSD Games. I didn't check the source code, so I am not sure if they are related as in sharing code, since the output looks quite similar.

Probably just be mimic output, the authors are different, so are the licenses and manpages. Anyway, it's really fast to calculate factors, factoring the eighth and ninth Mersenne primes:

$ time /usr/games/bin/factor 4951760154835678088235319297
4951760154835678088235319297: 2147483647 2305843009213693951

real 0m0.006s
user 0m0.003s
sys 0m0.002s

If I had known these, I probably would use them to solve Project Euler problems as shell scripting, I think since coreutils has `factor`, it's legit to me to solve the problems using `factor`, not a cheat.

$$#

/usr/bin/factor:

Version 8.21 via Gentoo sys-apps/coreutils-8.21
In C
By Paul Rubin, Torbjörn Granlund, and Niels Möller
GPLv3

/usr/games/bin/factor:

2004-02-08, from bsd-games 2.17 (2005-02-18) via Gentoo games-misc/bsd-games 2.17-r5
In C
By Landon Curt Noll
New BSD License (3-clause)

[1]: ftp://metalab.unc.edu/pub/Linux/games/bsd-games-2.17.tar.gz
[2]: http://www.gnu.org/software/coreutils/


Смотрите видео factor, from GNU coreutils or BSD Games онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Archived Yu-Jie Lin 18 Апрель 2014, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 624 раз и оно понравилось 1 людям.