.\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Landon Curt Noll. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)factor.6 8.1 (Berkeley) 5/31/93 .\" .\" %FreeBSD: src/games/factor/factor.6,v 1.8 2002/11/29 16:21:33 ru Exp % .\" .\" By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo .\" .\" chongo /\oo/\ .\" .\" $FreeBSD$ .\" 以下は Linux JM のクレジット .\" Japanese Version Copyright (c) 1997,1998 MAEHARA Kohichi .\" all rights reserved. .\" Translated Sat Feb 21 00:00:00 JST 1998 .\" by MAEHARA Kohichi .\" .\"WORD: 10 most wanted FBI の出す凶悪犯リスト .\" .\" .Dd October 10, 2002 .Dt FACTOR 6 .Os .Sh 名称 .Nm factor , primes .Nd factor は素因数分解を行なう, primes は素数を求める .Sh 書式 .Nm .Op Fl h .Op Ar number ... .Nm primes .Op Fl h .Op Ar start Op Ar stop .Sh 解説 .Nm ユーティリティは正 の整数を素因数分解します。 素因数分解されると、元の整数の後ろに .Ql \&: をつけて、 さらにその後ろに一行で因数のリストが表示されます。 因数は空白で区切りながら昇順に表示されます。 もし同じ因数で複数回割ることができる場合は、その因数は回数分表示されます。 .Pp .Nm に 1 つ以上の引数を与えて実行すると、 それぞれについて素因数分解を行います。 .Pp .Nm を引数無しで実行すると、 .Nm は一行につき一つの数値を、 ファイルの終了またはエラーとなるまで、標準入力から読み込みます。 先頭の空白ならびに空行は無視されます。 数字の前に一つだけ .Ql + の記号がついているのはかまいません。 数字は非数字キャラクタ (たとえば改行) で終了します。 数字を一つ読む毎に、それは素因数分解されます。 .Pp .Nm primes ユーティリティは .Ar start 以上 .Ar stop 未満の素数を一行に一つ、昇順で表示します。 .Ar start は最低でも 0 以上で、 .Ar stop 未満であることが必要です。 .Ar stop は最大値よりも大きくてはなりません。 .Ar stop のデフォルトおよび最大値は、 32 ビットアーキテクチャでは 4294967295 であり、 64 ビットアーキテクチャでは 18446744073709551615 です。 .Pp 引数なしで .Nm primes ユーティリティを起動した場合、 .Ar start は標準入力から読み込まれます。 この場合 .Ar stop として最大値が用いられます。 .Ar start の数字の頭に .Ql + 記号を付けるのはかまいません。 .Ar start の数字は非数字のキャラクタ (例えば改行) で終了します。 .Sh 診断 .Bl -diag .It "negative numbers aren't permitted" .It "illegal numeric format" .It "start value must be less than stop value" .It "Result too large" .El .Sh バグ .Nm は .Dq 十大凶悪 因子のリストを処理するのには使えませんし、 .Nm primes で素数の世界記録を求めることはできません。