[BACK]Return to num.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc / parts / builtin

Annotation of OpenXM/src/asir-doc/parts/builtin/num.texi, Revision 1.1.1.1

1.1       noro        1: @node $B?t$N1i;;(B,,, $BAH$_9~$_H!?t(B
                      2: @section $B?t$N1i;;(B
                      3:
                      4: @menu
                      5: * idiv irem::
                      6: * fac::
                      7: * igcd igcdcntl::
                      8: * ilcm::
                      9: * inv::
                     10: * prime lprime::
                     11: * random::
                     12: * mt_save mt_load::
                     13: * nm dn::
                     14: * conj real imag::
                     15: * eval::
                     16: * pari::
                     17: * setprec::
                     18: * setmod::
                     19: * lrandom::
                     20: @end menu
                     21:
                     22: @node idiv irem,,, $B?t$N1i;;(B
                     23: @subsection @code{idiv}, @code{irem}
                     24: @findex idiv
                     25: @findex irem
                     26:
                     27: @table @t
                     28: @item idiv(@var{i1},@var{i2})
                     29: :: $B@0?t=|;;$K$h$k>&(B.
                     30: @item irem(@var{i1},@var{i2})
                     31: :: $B@0?t=|;;$K$h$k>jM>(B.
                     32: @end table
                     33:
                     34: @table @var
                     35: @item return
                     36: $B@0?t(B
                     37: @item i1,i2
                     38: $B@0?t(B
                     39: @end table
                     40:
                     41: @itemize @bullet
                     42: @item
                     43: @var{i1} $B$N(B @var{i2} $B$K$h$k@0?t=|;;$K$h$k>&(B, $B>jM>$r5a$a$k(B.
                     44: @item
                     45: @var{i2} $B$O(B 0 $B$G$"$C$F$O$J$i$J$$(B.
                     46: @item
                     47: $BHo=|?t$,Ii$N>l9g(B, $B@dBPCM$KBP$9$kCM$K%^%$%J%9$r$D$1$?CM$rJV$9(B.
                     48: @item
                     49: @var{i1} @code{%} @var{i2} $B$O(B, $B7k2L$,@5$K@55,2=$5$l$k$3$H$r=|$1$P(B
                     50: @code{irem()} $B$NBe$o$j$KMQ$$$k$3$H$,$G$-$k(B.
                     51: @item
                     52: $BB?9`<0$N>l9g$O(B @code{sdiv}, @code{srem} $B$rMQ$$$k(B.
                     53: @end itemize
                     54:
                     55: @example
                     56: [0] idiv(100,7);
                     57: 14
                     58: [0] idiv(-100,7);
                     59: -14
                     60: [1] irem(100,7);
                     61: 2
                     62: [1] irem(-100,7);
                     63: -2
                     64: @end example
                     65:
                     66: @table @t
                     67: @item $B;2>H(B
                     68: @fref{sdiv sdivm srem sremm sqr sqrm}, @fref{%}.
                     69: @end table
                     70:
                     71: @node fac,,, $B?t$N1i;;(B
                     72: @subsection @code{fac}
                     73: @findex fac
                     74:
                     75: @table @t
                     76: @item fac(@var{i})
                     77: :: @var{i} $B$N3,>h(B.
                     78: @end table
                     79:
                     80: @table @var
                     81: @item return
                     82: $B@0?t(B
                     83: @item i
                     84: $B@0?t(B
                     85: @end table
                     86:
                     87: @itemize @bullet
                     88: @item
                     89: @var{i} $B$N3,>h$r7W;;$9$k(B.
                     90: @item
                     91: @var{i} $B$,Ii$N>l9g$O(B 0 $B$rJV$9(B.
                     92: @end itemize
                     93:
                     94: @example
                     95: [0] fac(50);
                     96: 30414093201713378043612608166064768844377641568960512000000000000
                     97: @end example
                     98:
                     99: @node igcd igcdcntl,,, $B?t$N1i;;(B
                    100: @subsection @code{igcd},@code{igcdcntl}
                    101: @findex igcd
                    102: @findex igcdcntl
                    103:
                    104: @table @t
                    105: @item igcd(@var{i1},@var{i2})
                    106: :: $B@0?t$N(B GCD ($B:GBg8xLs?t(B)
                    107: @item igcdcntl([@var{i}])
                    108: :: $B@0?t(B GCD$B$N%"%k%4%j%:%`A*Br(B
                    109: @end table
                    110:
                    111: @table @var
                    112: @item return
                    113: $B@0?t(B
                    114: @item i1,i2,i
                    115: $B@0?t(B
                    116: @end table
                    117:
                    118: @itemize @bullet
                    119: @item
                    120: @code{igcd} $B$O(B @var{i1} $B$H(B @var{i2} $B$N(B GCD $B$r5a$a$k(B.
                    121: @item
                    122: $B0z?t$,@0?t$G$J$$>l9g$O(B, $B%(%i!<$^$?$OL50UL#$J7k2L$rJV$9(B.
                    123: @item
                    124: $BB?9`<0$N>l9g$O(B, @code{gcd}, @code{gcdz} $B$rMQ$$$k(B.
                    125: @item
                    126: $B@0?t(B GCD $B$K$O$5$^$6$^$JJ}K!$,$"$j(B, @code{igcdcntl} $B$G@_Dj$G$-$k(B.
                    127:
                    128: @table @code
                    129: @item 0
                    130: Euclid $B8_=|K!(B (default)
                    131: @item 1
                    132: binary GCD
                    133: @item 2
                    134: bmod GCD
                    135: @item 3
                    136: accelerated integer GCD
                    137: @end table
                    138: 2, 3 $B$O(B K. Weber, ACM TOMS, Vol.21, No. 1 (1995), pp. 111-122 $B$K$h$k(B.
                    139:
                    140: $B$*$*$`$M(B 3 $B$,9bB.$@$,(B, $BNc30$b$"$k(B.
                    141: @end itemize
                    142:
                    143: @example
                    144: [0] A=lrandom(10^4)$
                    145: [1] B=lrandom(10^4)$
                    146: [2] C=lrandom(10^4)$
                    147: [3] D=A*C$
                    148: [4] E=A*B$
                    149: [5] cputime(1)$
                    150: [6] igcd(D,E)$
                    151: 0.6sec + gc : 1.93sec(2.531sec)
                    152: [7] igcdcntl(1)$
                    153: [8] igcd(D,E)$
                    154: 0.27sec(0.2635sec)
                    155: [9] igcdcntl(2)$
                    156: [10] igcd(D,E)$
                    157: 0.19sec(0.1928sec)
                    158: [11] igcdcntl(3)$
                    159: [12] igcd(D,E)$
                    160: 0.08sec(0.08023sec)
                    161: @end example
                    162:
                    163: @table @t
                    164: @item $B;2>H(B
                    165: @fref{gcd gcdz}.
                    166: @end table
                    167:
                    168: @node ilcm,,, $B?t$N1i;;(B
                    169: @subsection @code{ilcm}
                    170: @findex ilcm
                    171:
                    172: @table @t
                    173: @item ilcm(@var{i1},@var{i2})
                    174: :: $B:G>.8xG\?t$r5a$a$k(B.
                    175: @end table
                    176:
                    177: @table @var
                    178: @item return
                    179: $B@0?t(B
                    180: @item i1,i2
                    181: $B@0?t(B
                    182: @end table
                    183:
                    184: @itemize @bullet
                    185: @item
                    186: $B@0?t(B @var{i1}, @var{i2} $B$N:G>.8xG\?t$r5a$a$k(B.
                    187: @item
                    188: $B0lJ}$,(B 0 $B$N>l9g(B 0 $B$rJV$9(B.
                    189: @item
                    190:
                    191: @end itemize
                    192:
                    193: @table @t
                    194: @item $B;2>H(B
                    195: @fref{igcd igcdcntl}, @fref{mt_save mt_load}.
                    196: @end table
                    197: @node inv,,, $B?t$N1i;;(B
                    198: @subsection @code{inv}
                    199: @findex inv
                    200:
                    201: @table @t
                    202: @item inv(@var{i},@var{m})
                    203: :: @var{m} $B$rK!$H$9$k(B @var{i} $B$N5U?t(B
                    204: @end table
                    205:
                    206: @table @var
                    207: @item return
                    208: $B@0?t(B
                    209: @item i,m
                    210: $B@0?t(B
                    211: @end table
                    212:
                    213: @itemize @bullet
                    214: @item
                    215: @var{ia} @equiv{} 1 mod (@var{m}) $B$J$k@0?t(B @var{a} $B$r5a$a$k(B.
                    216: @item
                    217: @var{i} $B$H(B @var{m} $B$O8_$$$KAG$G$J$1$l$P$J$i$J$$$,(B, @code{inv()} $B$O(B
                    218: $B$=$N%A%'%C%/$O9T$o$J$$(B.
                    219: @end itemize
                    220:
                    221: @example
                    222: [71] igcd(1234,4321);
                    223: 1
                    224: [72] inv(1234,4321);
                    225: 3239
                    226: [73] irem(3239*1234,4321);
                    227: 1
                    228: @end example
                    229:
                    230: @table @t
                    231: @item $B;2>H(B
                    232: @fref{igcd igcdcntl}.
                    233: @end table
                    234:
                    235: @node prime lprime,,, $B?t$N1i;;(B
                    236: @subsection @code{prime}, @code{lprime}
                    237: @findex prime
                    238: @findex lprime
                    239:
                    240: @table @t
                    241: @item prime(@var{index})
                    242: @item lprime(@var{index})
                    243: :: $BAG?t$rJV$9(B
                    244: @end table
                    245:
                    246: @table @var
                    247: @item return
                    248: $B@0?t(B
                    249: @item index
                    250: $B@0?t(B
                    251: @end table
                    252:
                    253: @itemize @bullet
                    254: @item
                    255: @code{prime()}, @code{lprime()} $B$$$:$l$b%7%9%F%`$,FbIt$K;}$D(B
                    256: $BAG?tI=$NMWAG$rJV$9(B. @code{index} $B$O(B 0 $B0J>e$N@0?t$G(B, $BAG?tI=(B
                    257: $B$N%$%s%G%C%/%9$KMQ$$$i$l$k(B. @code{prime()} $B$O(B 16381 $B$^$G(B
                    258: $B$NAG?t$r>.$5$$=g$K(B 1900 $B8D(B, @code{lprime()} $B$O(B, 10 $B?J(B 8 $B7e$G:GBg$N(B
                    259: $BAG?t$+$iBg$-$$=g$K(B 999 $B8DJV$9(B. $B$=$l0J30$N%$%s%G%C%/%9$KBP$7$F$O(B
                    260: 0 $B$rJV$9(B.
                    261: @item
                    262: $B$h$j0lHLE*$JAG?t@8@.H!?t$H$7$F$O(B, @code{pari(nextprime,@var{number})}
                    263: $B$,$"$k(B.
                    264: @end itemize
                    265:
                    266: @example
                    267: [95] prime(0);
                    268: 2
                    269: [96] prime(1228);
                    270: 9973
                    271: [97] lprime(0);
                    272: 99999989
                    273: [98] lprime(999);
                    274: 0
                    275: @end example
                    276:
                    277: @table @t
                    278: @item $B;2>H(B
                    279: @fref{pari}.
                    280: @end table
                    281:
                    282: @node random,,, $B?t$N1i;;(B
                    283: @subsection @code{random}
                    284: @findex random
                    285:
                    286: @table @t
                    287: @item radom([@var{seed}])
                    288: :: $BMp?t$r@8@.$9$k(B.
                    289: @end table
                    290:
                    291: @table @var
                    292: @item seed
                    293: @item return
                    294: $B<+A3?t(B
                    295: @end table
                    296:
                    297: @itemize @bullet
                    298: @item
                    299: $B:GBg(B 2^32-1 $B$NHsIi@0?t$NMp?t$r@8@.$9$k(B.
                    300: @item
                    301: 0 $B$G$J$$0z?t$,$"$k;~(B, $B$=$NCM$r(B seed $B$H$7$F@_Dj$7$F$+$i(B, $BMp?t$r@8@.$9$k(B.
                    302: @item
                    303: default $B$N(B seed $B$O8GDj$N$?$a(B, $B<o$r@_Dj$7$J$1$l$P(B, $B@8@.$5$l$kMp?t$N(B
                    304: $B7ONs$O5/F0Kh$K0lDj$G$"$k(B.
                    305: @item
                    306: $B>>K\bC(B-$B@>B<Bs;N$K$h$k(B Mersenne Twister (http://www.math.keio.ac.jp/matsumoto/mt.html) $B%"%k%4%j%:%`$N(B, $BH`$i<+?H$K$h$k<BAu$rMQ$$$F$$$k(B.
                    307: @item
                    308: $B<~4|$O(B 2^19937-1 $B$HHs>o$KD9$$(B.
                    309: @item
                    310: @code{mt_save} $B$K$h$j(B state $B$r%U%!%$%k$K(B save $B$G$-$k(B. $B$3$l$r(B @code{mt_load}
                    311: $B$GFI$_9~$`$3$H$K$h$j(B, $B0[$k(B Asir $B%;%C%7%g%s4V$G0l$D$NMp?t$N7ONs$rC)$k$3$H$,(B
                    312: $B$G$-$k(B.
                    313: @end itemize
                    314:
                    315: @table @t
                    316: @item $B;2>H(B
                    317: @fref{lrandom}, @fref{mt_save mt_load}.
                    318: @end table
                    319:
                    320: @node lrandom,,, $B?t$N1i;;(B
                    321: @subsection @code{lrandom}
                    322: @findex lrandom
                    323:
                    324: @table @t
                    325: @item lradom(@var{bit})
                    326: :: $BB?G\D9Mp?t$r@8@.$9$k(B.
                    327: @end table
                    328:
                    329: @table @var
                    330: @item bit
                    331: @item return
                    332: $B<+A3?t(B
                    333: @end table
                    334:
                    335: @itemize @bullet
                    336: @item
                    337: $B9b!9(B @var{bit} $B$NHsIi@0?t$NMp?t$r@8@.$9$k(B.
                    338: @item
                    339: @code{random} $B$rJ#?t2s8F$S=P$7$F7k9g$7(B, $B;XDj$N(B bit $BD9$K%^%9%/$7$F$$$k(B.
                    340: @end itemize
                    341:
                    342: @table @t
                    343: @item $B;2>H(B
                    344: @fref{random}, @fref{mt_save mt_load}.
                    345: @end table
                    346:
                    347: @node mt_save mt_load,,, $B?t$N1i;;(B
                    348: @subsection @code{mt_save}, @code{mt_load}
                    349: @findex mt_save
                    350: @findex mt_load
                    351:
                    352: @table @t
                    353: @item mt_save(@var{fname})
                    354: :: $BMp?t@8@.4o$N8=:_$N>uBV$r%U%!%$%k$K%;!<%V$9$k(B.
                    355: @item mt_load(@var{fname})
                    356: :: $B%U%!%$%k$K%;!<%V$5$l$?Mp?t@8@.4o$N>uBV$r%m!<%I$9$k(B.
                    357: @end table
                    358:
                    359: @table @var
                    360: @item return
                    361: 0 $B$^$?$O(B 1
                    362: @item fname
                    363: $BJ8;zNs(B
                    364: @end table
                    365:
                    366: @itemize @bullet
                    367: @item $B$"$k>uBV$r%;!<%V$7(B, $B$=$N>uBV$r%m!<%I$9$k$3$H$G(B,
                    368: $B0l$D$N5?;wMp?t7ONs$r(B, $B?75,$N(B Asir $B%;%C%7%g%s$GB3$1$F$?$I$k$3$H$,(B
                    369: $B$G$-$k(B.
                    370: @end itemize
                    371:
                    372: @example
                    373: [340] random();
                    374: 3510405877
                    375: [341] mt_save("/tmp/mt_state");
                    376: 1
                    377: [342] random();
                    378: 4290933890
                    379: [343] quit;
                    380: % asir
                    381: This is Asir, Version 991108.
                    382: Copyright (C) FUJITSU LABORATORIES LIMITED.
                    383: 3 March 1994. All rights reserved.
                    384: [340] mt_load("/tmp/mt_state");
                    385: 1
                    386: [341] random();
                    387: 4290933890
                    388: @end example
                    389:
                    390: @table @t
                    391: @item $B;2>H(B
                    392: @fref{random}, @fref{lrandom}.
                    393: @end table
                    394:
                    395: @node nm dn,,, $B?t$N1i;;(B
                    396: @subsection @code{nm}, @code{dn}
                    397: @findex nm
                    398: @findex dn
                    399:
                    400: @table @t
                    401: @item nm(@var{rat})
                    402: :: @var{rat} $B$NJ,;R(B.
                    403: @item dn(@var{rat})
                    404: :: @var{rat} $B$NJ,Jl(B.
                    405: @end table
                    406:
                    407: @table @var
                    408: @item return
                    409: $B@0?t$^$?$OB?9`<0(B
                    410: @item rat
                    411: $BM-M}?t$^$?$OM-M}<0(B
                    412: @end table
                    413:
                    414: @itemize @bullet
                    415: @item
                    416: $BM?$($i$l$?M-M}?t$^$?M-M}<0$NJ,;R5Z$SJ,Jl$rJV$9(B.
                    417: @item
                    418: $BM-M}?t$N>l9g(B, $BJ,Jl$O>o$K@5$G(B, $BId9f$OJ,;R$,;}$D(B.
                    419: @item
                    420: $BM-M}<0$N>l9g(B, $BC1$KJ,Jl(B, $BJ,;R$r<h$j=P$9$@$1$G$"$k(B.
                    421: $BM-M}<0$KBP$7$F$O(B, $BLsJ,$O<+F0E*$K$O9T$o$l$J$$(B. @code{red()}
                    422: $B$rL@<(E*$K8F$S=P$9I,MW$,$"$k(B.
                    423: @end itemize
                    424:
                    425: @example
                    426: [2] [nm(-43/8),dn(-43/8)];
                    427: [-43,8]
                    428: [3] dn((x*z)/(x*y));
                    429: y*x
                    430: [3] dn(red((x*z)/(x*y)));
                    431: y
                    432: @end example
                    433:
                    434: @table @t
                    435: @item $B;2>H(B
                    436: @fref{red}.
                    437: @end table
                    438:
                    439: @node conj real imag,,, $B?t$N1i;;(B
                    440: @subsection @code{conj}, @code{real}, @code{imag}
                    441: @findex conj
                    442:
                    443: @table @t
                    444: @item real(@var{comp})
                    445: :: @var{comp} $B$N<B?tItJ,(B.
                    446: @item imag(@var{comp})
                    447: :: @var{comp} $B$N5u?tItJ,(B.
                    448: @item conj(@var{comp})
                    449: :: @var{comp} $B$N6&LrJ#AG?t(B.
                    450: @end table
                    451:
                    452: @table @var
                    453: @item return comp
                    454: $BJ#AG?t(B
                    455: @end table
                    456:
                    457: @itemize @bullet
                    458: @item
                    459: $BJ#AG?t$KBP$7(B, $B<BIt(B, $B5uIt(B, $B6&Lr$r5a$a$k(B.
                    460: @item
                    461: $B$3$l$i$O(B, $BB?9`<0$KBP$7$F$bF/$/(B.
                    462: @end itemize
                    463:
                    464: @example
                    465: [111] A=(2+@@i)^3;
                    466: (2+11*@@i)
                    467: [112] [real(A),imag(A),conj(A)];
                    468: [2,11,(2-11*@@i)]
                    469: @end example
                    470:
                    471: @node eval,,, $B?t$N1i;;(B
                    472: @subsection @code{eval}
                    473: @findex eval
                    474: @cindex PARI
                    475:
                    476: @table @t
                    477: @item eval(@var{obj}[,@var{prec}])
                    478: :: @var{obj} $B$NCM$NI>2A(B.
                    479: @end table
                    480:
                    481: @table @var
                    482: @item return
                    483: $B?t$"$k$$$O<0(B
                    484: @item obj
                    485: $B0lHL$N<0(B
                    486: @item prec
                    487: $B@0?t(B
                    488: @end table
                    489:
                    490: @itemize @bullet
                    491: @item
                    492: @var{obj} $B$K4^$^$l$kH!?t$NCM$r2DG=$J8B$jI>2A$9$k(B.
                    493: @item
                    494: $B7W;;$O(B @b{PARI} (@xref{pari}) $B$,9T$&(B.
                    495: @item
                    496: @var{prec} $B$r;XDj$7$?>l9g(B, $B7W;;$O(B, 10 $B?J(B @var{prec} $B7eDxEY$G9T$o$l$k(B.
                    497: @var{prec} $B$N;XDj$,$J$$>l9g(B, $B8=:_@_Dj$5$l$F$$$k@:EY$G9T$o$l$k(B.
                    498: (@xref{setprec})
                    499: @item
                    500: @table @t
                    501: @item $B07$($kH!?t$O(B, $B<!$NDL$j(B.
                    502: @code{sin}, @code{cos}, @code{tan},
                    503:
                    504: @code{asin}, @code{acos}, @code{atan},
                    505:
                    506: @code{sinh}, @code{cosh}, @code{tanh},
                    507:
                    508: @code{asinh}, @code{acosh}, @code{atanh},
                    509:
                    510: @code{exp}, @code{log}, @code{pow(a,b) (a^b)}
                    511: @end table
                    512: @item
                    513: $B0J2<$N5-9f$r?t$H$7$FI>2A$G$-$k(B.
                    514: @table @t
                    515: @item @@i
                    516: $B5u?tC10L(B
                    517: @item @@pi
                    518: $B1_<~N((B
                    519: @item @@e
                    520: $B<+A3BP?t$NDl(B
                    521: @end table
                    522: @end itemize
                    523:
                    524: @example
                    525: [118] eval(exp(@@pi*@@i));
                    526: -1.0000000000000000000000000000
                    527: [119] eval(2^(1/2));
                    528: 1.414213562373095048763788073031
                    529: [120] eval(sin(@@pi/3));
                    530: 0.86602540378443864674620506632
                    531: [121] eval(sin(@@pi/3)-3^(1/2)/2,50);
                    532: -2.78791084448179148471 E-58
                    533: @end example
                    534:
                    535: @table @t
                    536: @item $B;2>H(B
                    537: @fref{ctrl}, @fref{setprec}, @fref{pari}.
                    538: @end table
                    539:
                    540: @node pari,,, $B?t$N1i;;(B
                    541: @subsection @code{pari}
                    542: @findex pari
                    543: @cindex PARI
                    544:
                    545: @table @t
                    546: @item pari(@var{func},@var{arg},@var{prec})
                    547: :: @b{PARI} $B$NH!?t(B @var{func} $B$r8F$S=P$9(B.
                    548: @end table
                    549:
                    550: @table @var
                    551: @item return
                    552: @var{func} $BKh$K0[$J$k(B.
                    553: @item func
                    554: @b{PARI} $B$NH!?tL>(B
                    555: @item arg
                    556: @var{func} $B$N0z?t(B
                    557: @item prec
                    558: $B@0?t(B
                    559: @end table
                    560:
                    561: @itemize @bullet
                    562: @item
                    563: @b{PARI} $B$NH!?t$r8F$S=P$9(B.
                    564:
                    565: @item
                    566: @b{PARI} @code{[Batut et al.]} $B$O(B Bordeaux $BBg3X$G3+H/$5$l%U(B
                    567: $B%j!<%=%U%H%&%'%"$H$7$F8x3+$5$l$F$$$k(B. @b{PARI} $B$O?t<0=hM}E*$J5!G=$rM-(B
                    568: $B$7$F$O$$$k$,(B, $B<g$J%?!<%2%C%H$O@0?tO@$K4XO"$7$??t(B (@b{bignum},
                    569: @b{bigfloat}) $B$N1i;;$G(B, $B;MB'1i;;$K8B$i$:(B@b{bigfloat} $B$K$h$k$5$^$6$^$J(B
                    570: $BH!?tCM$NI>2A$r9bB.$K9T$&$3$H$,$G$-$k(B. @b{PARI} $B$OB>$N%W%m%0%i%`$+$i(B
                    571: $B%5%V%k!<%A%s%i%$%V%i%j$H$7$FMQ$$$k$3$H$,$G$-(B, $B$^$?(B, @samp{gp} $B$H$$$&(B
                    572: @b{PARI}$B%i%$%V%i%j$N%$%s%?%U%'!<%9$K$h$j(B UNIX $B$N%"%W%j%1!<%7%g%s$H$7$F(B
                    573: $BMxMQ$9$k$3$H$b$G$-$k(B. $B8=:_$N%P!<%8%g%s$O(B @b{1.39} $B$G$$$/$D$+$N(B ftp
                    574: site ($B$?$H$($P(B @code{math.ucla.edu:/pub/pari})
                    575: $B$+$i(B anonymous ftp $B$G$-$k(B.
                    576: @item
                    577: $B:G8e$N0z?t(B @var{prec} $B$G7W;;@:EY$r;XDj$G$-$k(B.
                    578: @var{prec} $B$r>JN,$7$?>l9g(B @code{setprec()} $B$G;XDj$7$?@:EY$H$J$k(B.
                    579: @item
                    580: $B8=;~E@$G<B9T$G$-$k(B @b{PARI} $B$NH!?t$O<!$NDL$j$G$"$k(B. $B$$$:$l$b(B
                    581: 1 $B0z?t$G(B @b{Asir} $B$,BP1~$G$-$k7?$N0z?t$r$H$kH!?t$G$"$k(B.
                    582: $B$J$*3F!9$N5!G=$K$D$$$F$O(B @b{PARI} $B$N%^%K%e%"%k$r;2>H$N$3$H(B.
                    583:
                    584: @code{abs},
                    585: @code{adj},
                    586: @code{arg},
                    587: @code{bigomega},
                    588: @code{binary},
                    589: @code{ceil},
                    590: @code{centerlift},
                    591: @code{cf},
                    592: @code{classno},
                    593: @code{classno2},
                    594: @code{conj},
                    595: @code{content},
                    596: @code{denom},
                    597: @code{det},
                    598: @code{det2},
                    599: @code{detr},
                    600: @code{dilog},
                    601: @code{disc},
                    602: @code{discf},
                    603: @code{divisors},
                    604: @code{eigen},
                    605: @code{eintg1},
                    606: @code{erfc},
                    607: @code{eta},
                    608: @code{floor},
                    609: @code{frac},
                    610: @code{galois},
                    611: @code{galoisconj},
                    612: @code{gamh},
                    613: @code{gamma},
                    614: @code{hclassno},
                    615: @code{hermite},
                    616: @code{hess},
                    617: @code{imag},
                    618: @code{image},
                    619: @code{image2},
                    620: @code{indexrank},
                    621: @code{indsort},
                    622: @code{initalg},
                    623: @code{isfund},
                    624: @code{isprime},
                    625: @code{ispsp},
                    626: @code{isqrt},
                    627: @code{issqfree},
                    628: @code{issquare},
                    629: @code{jacobi},
                    630: @code{jell},
                    631: @code{ker},
                    632: @code{keri},
                    633: @code{kerint},
                    634: @code{kerintg1},
                    635: @code{kerint2},
                    636: @code{kerr},
                    637: @code{length},
                    638: @code{lexsort},
                    639: @code{lift},
                    640: @code{lindep},
                    641: @code{lll},
                    642: @code{lllg1},
                    643: @code{lllgen},
                    644: @code{lllgram},
                    645: @code{lllgramg1},
                    646: @code{lllgramgen},
                    647: @code{lllgramint},
                    648: @code{lllgramkerim},
                    649: @iftex
                    650: @break
                    651: @end iftex
                    652: @code{lllgramkerimgen},
                    653: @code{lllint},
                    654: @code{lllkerim},
                    655: @code{lllkerimgen},
                    656: @code{lllrat},
                    657: @code{lngamma},
                    658: @code{logagm},
                    659: @code{mat},
                    660: @code{matinvr},
                    661: @code{matrixqz2},
                    662: @code{matrixqz3},
                    663: @code{matsize},
                    664: @code{modreverse},
                    665: @code{mu},
                    666: @code{nextprime},
                    667: @code{norm},
                    668: @code{norml2},
                    669: @code{numdiv},
                    670: @code{numer},
                    671: @code{omega},
                    672: @code{order},
                    673: @code{ordred},
                    674: @code{phi},
                    675: @code{pnqn},
                    676: @code{polred},
                    677: @code{polred2},
                    678: @code{primroot},
                    679: @code{psi},
                    680: @code{quadgen},
                    681: @code{quadpoly},
                    682: @code{real},
                    683: @code{recip},
                    684: @code{redcomp},
                    685: @code{redreal},
                    686: @code{regula},
                    687: @code{reorder},
                    688: @code{reverse},
                    689: @code{rhoreal},
                    690: @code{roots},
                    691: @code{rootslong},
                    692: @code{round},
                    693: @code{sigma},
                    694: @code{signat},
                    695: @code{simplify},
                    696: @code{smalldiscf},
                    697: @code{smallfact},
                    698: @code{smallpolred},
                    699: @code{smallpolred2},
                    700: @code{smith},
                    701: @code{smith2},
                    702: @code{sort},
                    703: @code{sqr},
                    704: @code{sqred},
                    705: @code{sqrt},
                    706: @code{supplement},
                    707: @code{trace},
                    708: @code{trans},
                    709: @code{trunc},
                    710: @code{type},
                    711: @code{unit},
                    712: @code{vec},
                    713: @code{wf},
                    714: @code{wf2},
                    715: @code{zeta}
                    716:
                    717: @item
                    718: @b{Asir} $B$GMQ$$$F$$$k$N$O(B @b{PARI} $B$N$[$s$N0lIt$N5!G=$G$"$k$,(B, $B:#8e(B
                    719: $B$h$jB?$/$N5!G=$,MxMQ$G$-$k$h$&2~NI$9$kM=Dj$G$"$k(B.
                    720: @end itemize
                    721:
                    722: @example
                    723: /* $B9TNs$N8GM-%Y%/%H%k$r5a$a$k(B. */
                    724: [0] pari(eigen,newmat(2,2,[[1,1],[1,2]]));
                    725: [ -1.61803398874989484819771921990 0.61803398874989484826 ]
                    726: [ 1 1 ]
                    727: /* 1 $BJQ?tB?9`<0$N:,$r5a$a$k(B. */
                    728: [1] pari(roots,t^2-2);
                    729: [ -1.41421356237309504876 1.41421356237309504876 ]
                    730: @end example
                    731:
                    732: @table @t
                    733: @item $B;2>H(B
                    734: @fref{setprec}.
                    735: @end table
                    736:
                    737: @node setprec,,, $B?t$N1i;;(B
                    738: @subsection @code{setprec}
                    739: @findex setprec
                    740: @cindex PARI
                    741:
                    742: @table @t
                    743: @item setprec([@var{n}])
                    744: :: @b{bigfloat} $B$N7e?t$r(B @var{n} $B7e$K@_Dj$9$k(B.
                    745: @end table
                    746:
                    747: @table @var
                    748: @item return
                    749: $B@0?t(B
                    750: @item n
                    751: $B@0?t(B
                    752: @end table
                    753:
                    754: @itemize @bullet
                    755: @item
                    756: $B0z?t$,$"$k>l9g(B, @b{bigfloat} $B$N7e?t$r(B @var{n} $B7e$K@_Dj$9$k(B.
                    757: $B0z?t$N$"$k$J$7$K$+$+$o$i$:(B, $B0JA0$K@_Dj$5$l$F$$$?CM$rJV$9(B.
                    758: @item
                    759: @b{bigfloat} $B$N7W;;$O(B @b{PARI} (@xref{pari}) $B$K$h$C$F9T$o$l$k(B.
                    760: @item
                    761: @b{bigfloat} $B$G$N7W;;$KBP$7M-8z$G$"$k(B.
                    762: @b{bigfloat} $B$N(B flag $B$r(B on $B$K$9$kJ}K!$O(B, @code{ctrl} $B$r;2>H(B.
                    763: @item
                    764: $B@_Dj$G$-$k7e?t$K>e8B$O$J$$$,(B, $B;XDj$7$?7e?t$K@_Dj$5$l$k$H$O(B
                    765: $B8B$i$J$$(B. $BBg$-$a$NCM$r@_Dj$9$k$N$,0BA4$G$"$k(B.
                    766: @end itemize
                    767:
                    768: @example
                    769: [1] setprec();
                    770: 9
                    771: [2] setprec(100);
                    772: 9
                    773: [3] setprec(100);
                    774: 96
                    775: @end example
                    776:
                    777: @table @t
                    778: @item $B;2>H(B
                    779: @fref{ctrl}, @fref{eval}, @fref{pari}.
                    780: @end table
                    781:
                    782: @node setmod,,, $B?t$N1i;;(B
                    783: @subsection @code{setmod}
                    784: @findex setmod
                    785:
                    786: @table @t
                    787: @item setmod([@var{p}])
                    788: :: $BM-8BBN$r(B GF(@var{p}) $B$K@_Dj$9$k(B.
                    789: @end table
                    790:
                    791: @table @var
                    792: @item return
                    793: $B@0?t(B
                    794: @item n
                    795: 2^27 $BL$K~$NAG?t(B
                    796: @end table
                    797:
                    798: @itemize @bullet
                    799: @item
                    800: $BM-8BBN$r(B GF(@var{p}) $B$K@_Dj$9$k(B. $B@_DjCM$rJV$9(B.
                    801: @item
                    802: $BM-8BBN$N85$N7?$r;}$D?t$O(B, $B$=$l<+?H$O$I$NM-8BBN$KB0$9$k$+$N>pJs$r;}$?$:(B,
                    803: $B8=:_@_Dj$5$l$F$$$kAG?t(B @var{p} $B$K$h$j(B GF(@var{p}) $B>e$G$N1i;;$,E,MQ$5$l$k(B.
                    804: @end itemize
                    805:
                    806: @example
                    807: [0] A=dp_mod(dp_ptod(2*x,[x]),3,[]);
                    808: (2)*<<1>>
                    809: [1] A+A;
                    810: addmi : invalid modulus
                    811: return to toplevel
                    812: [1] setmod(3);
                    813: 3
                    814: [2] A+A;
                    815: (1)*<<1>>
                    816: @end example
                    817:
                    818: @table @t
                    819: @item $B;2>H(B
                    820: @fref{dp_mod dp_rat}, @fref{$B?t$N7?(B}.
                    821: @end table
                    822:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>