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

Diff for /OpenXM/src/asir-doc/parts/builtin/num.texi between version 1.7 and 1.11

version 1.7, 2002/09/03 01:50:59 version 1.11, 2016/03/22 07:25:14
Line 1 
Line 1 
 @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/num.texi,v 1.6 2002/08/08 05:24:37 noro Exp $  @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/num.texi,v 1.10 2003/12/20 20:02:28 ohara Exp $
 \BJP  \BJP
 @node $B?t$N1i;;(B,,, $BAH$_9~$_H!?t(B  @node $B?t$N1i;;(B,,, $BAH$_9~$_H!?t(B
 @section $B?t$N1i;;(B  @section $B?t$N1i;;(B
Line 13 
Line 13 
 * fac::  * fac::
 * igcd igcdcntl::  * igcd igcdcntl::
 * ilcm::  * ilcm::
   * isqrt::
 * inv::  * inv::
 * prime lprime::  * prime lprime::
 * random::  * random::
Line 46 
Line 47 
 @item return  @item return
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @item i1,i2  @item i1 i2
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @end table  @end table
Line 159  Returns 0 if the argument @var{i} is negative.
Line 160  Returns 0 if the argument @var{i} is negative.
 @item return  @item return
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @item i1,i2,i  @item i1 i2 i
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @end table  @end table
Line 260  In most cases @code{3} is the fastest, but there are e
Line 261  In most cases @code{3} is the fastest, but there are e
 @item return  @item return
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @item i1,i2  @item i1 i2
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @end table  @end table
Line 287  If one of argument is equal to 0, the return 0.
Line 288  If one of argument is equal to 0, the return 0.
 @fref{igcd igcdcntl}, @fref{mt_save mt_load}.  @fref{igcd igcdcntl}, @fref{mt_save mt_load}.
 @end table  @end table
   
   \JP @node isqrt,,, $B?t$N1i;;(B
   \EG @node isqrt,,, Numbers
   @subsection @code{isqrt}
   @findex isqrt
   
   @table @t
   @item isqrt(@var{n})
   \JP :: $BJ?J}:,$r1[$($J$$:GBg$N@0?t$r5a$a$k(B.
   \EG :: The integer square root of @var{n}.
   @end table
   
   @table @var
   @item return
   \JP $BHsIi@0?t(B
   \EG non-negative integer
   @item n
   \JP $BHsIi@0?t(B
   \EG non-negative integer
   @end table
   
 \JP @node inv,,, $B?t$N1i;;(B  \JP @node inv,,, $B?t$N1i;;(B
 \EG @node inv,,, Numbers  \EG @node inv,,, Numbers
 @subsection @code{inv}  @subsection @code{inv}
Line 302  If one of argument is equal to 0, the return 0.
Line 323  If one of argument is equal to 0, the return 0.
 @item return  @item return
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @item i,m  @item i m
 \JP $B@0?t(B  \JP $B@0?t(B
 \EG integer  \EG integer
 @end table  @end table
Line 727  These functions works also for polynomials with comple
Line 748  These functions works also for polynomials with comple
 @code{deval} $B$OG\@:EYIbF0>.?t$r7k2L$H$7$F(B  @code{deval} $B$OG\@:EYIbF0>.?t$r7k2L$H$7$F(B
 @code{eval} $B$N>l9g(B, $BM-M}?t$O$=$N$^$^;D$k(B.  @code{eval} $B$N>l9g(B, $BM-M}?t$O$=$N$^$^;D$k(B.
 @item  @item
 @code{eval} $B$K$*$$$F$O(B, $B7W;;$O(B @b{PARI} (@ref{pari}) $B$,9T$&(B.  @code{eval} $B$K$*$$$F$O(B, $B7W;;$O(B @b{MPFR} $B%i%$%V%i%j$,9T$&(B.
 @code{deval} $B$K$*$$$F$O(B, $B7W;;$O(B C $B?t3X%i%$%V%i%j$N4X?t$rMQ$$$F9T$&(B.  @code{deval} $B$K$*$$$F$O(B, $B7W;;$O(B C $B?t3X%i%$%V%i%j$N4X?t$rMQ$$$F9T$&(B.
 @item  @item
 @code{deval} $B$OJ#AG?t$O07$($J$$(B.  @code{deval} $B$OJ#AG?t$O07$($J$$(B.
Line 735  These functions works also for polynomials with comple
Line 756  These functions works also for polynomials with comple
 @code{eval} $B$K$*$$$F$O(B,  @code{eval} $B$K$*$$$F$O(B,
 @var{prec} $B$r;XDj$7$?>l9g(B, $B7W;;$O(B, 10 $B?J(B @var{prec} $B7eDxEY$G9T$o$l$k(B.  @var{prec} $B$r;XDj$7$?>l9g(B, $B7W;;$O(B, 10 $B?J(B @var{prec} $B7eDxEY$G9T$o$l$k(B.
 @var{prec} $B$N;XDj$,$J$$>l9g(B, $B8=:_@_Dj$5$l$F$$$k@:EY$G9T$o$l$k(B.  @var{prec} $B$N;XDj$,$J$$>l9g(B, $B8=:_@_Dj$5$l$F$$$k@:EY$G9T$o$l$k(B.
 (@xref{setprec}.)  (@xref{setprec}, @xref{setbprec}.)
 @item  @item
 @table @t  @table @t
 @item $B07$($kH!?t$O(B, $B<!$NDL$j(B.  @item $B07$($kH!?t$O(B, $B<!$NDL$j(B.
Line 770  possible.
Line 791  possible.
 double float. Rational numbers remain unchanged in results from @code{eval}.  double float. Rational numbers remain unchanged in results from @code{eval}.
 @item  @item
 In @code{eval} the computation is done  In @code{eval} the computation is done
 by @b{PARI}. (@xref{pari}.) In @code{deval} the computation is  by @b{MPFR} library. In @code{deval} the computation is
 done by the C math library.  done by the C math library.
 @item  @item
 @code{deval} cannot handle complex numbers.  @code{deval} cannot handle complex numbers.
Line 781  If @var{prec} is not specified, computation is perform
Line 802  If @var{prec} is not specified, computation is perform
 precision set currently. (@xref{setprec}.)  precision set currently. (@xref{setprec}.)
 @item  @item
 Currently available numerical functions are listed below.  Currently available numerical functions are listed below.
 Note they are only a small part of whole @b{PARI} functions.  
   
 @table @t  @table @t
 @code{sin}, @code{cos}, @code{tan},  @code{sin}, @code{cos}, @code{tan},
Line 826  Napier's number (@t{exp}(1))
Line 846  Napier's number (@t{exp}(1))
 @table @t  @table @t
 \JP @item $B;2>H(B  \JP @item $B;2>H(B
 \EG @item References  \EG @item References
 @fref{ctrl}, @fref{setprec}, @fref{pari}.  @fref{ctrl}, @fref{setprec}, @fref{setbprec}.
 @end table  @end table
   
 \JP @node pari,,, $B?t$N1i;;(B  \JP @node pari,,, $B?t$N1i;;(B
Line 869  Napier's number (@t{exp}(1))
Line 889  Napier's number (@t{exp}(1))
 $BH!?tCM$NI>2A$r9bB.$K9T$&$3$H$,$G$-$k(B. @b{PARI} $B$OB>$N%W%m%0%i%`$+$i(B  $BH!?tCM$NI>2A$r9bB.$K9T$&$3$H$,$G$-$k(B. @b{PARI} $B$OB>$N%W%m%0%i%`$+$i(B
 $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  $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
 @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  @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
 $BMxMQ$9$k$3$H$b$G$-$k(B. $B8=:_$N%P!<%8%g%s$O(B @b{2.0.17beta} $B$G$$$/$D$+$N(B ftp  $BMxMQ$9$k$3$H$b$G$-$k(B.
 site ($B$?$H$($P(B @code{ftp://megrez.ceremab.u-bordeaux.fr/pub/pari})  
 $B$+$i(B anonymous ftp $B$G$-$k(B.  
 @item  @item
 $B:G8e$N0z?t(B @var{prec} $B$G7W;;@:EY$r;XDj$G$-$k(B.  $B:G8e$N0z?t(B @var{prec} $B$G7W;;@:EY$r;XDj$G$-$k(B.
 @var{prec} $B$r>JN,$7$?>l9g(B @code{setprec()} $B$G;XDj$7$?@:EY$H$J$k(B.  @var{prec} $B$r>JN,$7$?>l9g(B @code{setprec()} $B$G;XDj$7$?@:EY$H$J$k(B.
Line 893  function evaluations as well as arithmetic operations 
Line 911  function evaluations as well as arithmetic operations 
 speed.  It can also be used from other external programs as a library.  speed.  It can also be used from other external programs as a library.
 It provides a language interface named @samp{gp} to its library, which  It provides a language interface named @samp{gp} to its library, which
 enables a user to use @b{PARI} as a calculator which runs on UNIX.  enables a user to use @b{PARI} as a calculator which runs on UNIX.
 The current version is @b{2.0.17beta}.  It can be obtained by several ftp  
 sites. (For example, @code{ftp://megrez.ceremab.u-bordeaux.fr/pub/pari}.)  
 @item  @item
 The last argument (optional) @var{int} specifies the precision in digits  The last argument (optional) @var{int} specifies the precision in digits
 for bigfloat operation.  for bigfloat operation.
Line 1041  For details of individual functions, refer to the @b{P
Line 1057  For details of individual functions, refer to the @b{P
   
 \BJP  \BJP
 @item  @item
 @b{Asir} $B$GMQ$$$F$$$k$N$O(B @b{PARI} $B$N$[$s$N0lIt$N5!G=$G$"$k$,(B, $B:#8e(B  @b{Asir} $B$GMQ$$$F$$$k$N$O(B @b{PARI} $B$N$[$s$N0lIt$N5!G=$G$"$k(B.
 $B$h$jB?$/$N5!G=$,MxMQ$G$-$k$h$&2~NI$9$kM=Dj$G$"$k(B.  
 \E  \E
 \BEG  \BEG
 @item  @item
 @b{Asir} currently uses only a very small subset of @b{PARI}.  @b{Asir} currently uses only a very small subset of @b{PARI}.
 We will improve @b{Asir} so that it can provide more functions of  
 @b{PARI}.  
 \E  \E
 @end itemize  @end itemize
   
Line 1070  We will improve @b{Asir} so that it can provide more f
Line 1083  We will improve @b{Asir} so that it can provide more f
 @fref{setprec}.  @fref{setprec}.
 @end table  @end table
   
 \JP @node setprec,,, $B?t$N1i;;(B  \JP @node setbprec setprec,,, $B?t$N1i;;(B
 \EG @node setprec,,, Numbers  \EG @node setbprec setprec,,, Numbers
 @subsection @code{setprec}  @subsection @code{setbprec}, @code{setprec}
   @findex setbprec
 @findex setprec  @findex setprec
 @cindex PARI  
   
 @table @t  @table @t
 @item setprec([@var{n}])  @item setbprec([@var{n}])
 \JP :: @b{bigfloat} $B$N7e?t$r(B @var{n} $B7e$K@_Dj$9$k(B.  @itemx setprec([@var{n}])
 \EG :: Sets the precision for @b{bigfloat} operations to @var{n} digits.  \JP :: @b{setbprec}, @b{setprec} $B$O(B @b{bigfloat} $B$N@:EY$r$=$l$>$l(B 2 $B?J(B, 10$B?J(B @var{n} $B7e$K@_Dj$9$k(B.
   \EG :: @b{setbprec}, @b{setprec} set the precision for @b{bigfloat} operations to @var{n} bits, @var{n} digits respectively.
 @end table  @end table
   
 @table @var  @table @var
Line 1097  We will improve @b{Asir} so that it can provide more f
Line 1111  We will improve @b{Asir} so that it can provide more f
 $B0z?t$,$"$k>l9g(B, @b{bigfloat} $B$N7e?t$r(B @var{n} $B7e$K@_Dj$9$k(B.  $B0z?t$,$"$k>l9g(B, @b{bigfloat} $B$N7e?t$r(B @var{n} $B7e$K@_Dj$9$k(B.
 $B0z?t$N$"$k$J$7$K$+$+$o$i$:(B, $B0JA0$K@_Dj$5$l$F$$$?CM$rJV$9(B.  $B0z?t$N$"$k$J$7$K$+$+$o$i$:(B, $B0JA0$K@_Dj$5$l$F$$$?CM$rJV$9(B.
 @item  @item
 @b{bigfloat} $B$N7W;;$O(B @b{PARI} (@ref{pari}) $B$K$h$C$F9T$o$l$k(B.  @b{bigfloat} $B$N7W;;$O(B @b{MPFR} $B%i%$%V%i%j$K$h$C$F9T$o$l$k(B.
 @item  @item
 @b{bigfloat} $B$G$N7W;;$KBP$7M-8z$G$"$k(B.  @b{bigfloat} $B$G$N7W;;$KBP$7M-8z$G$"$k(B.
 @b{bigfloat} $B$N(B flag $B$r(B on $B$K$9$kJ}K!$O(B, @code{ctrl} $B$r;2>H(B.  @b{bigfloat} $B$N(B flag $B$r(B on $B$K$9$kJ}K!$O(B, @code{ctrl} $B$r;2>H(B.
Line 1107  We will improve @b{Asir} so that it can provide more f
Line 1121  We will improve @b{Asir} so that it can provide more f
 \E  \E
 \BEG  \BEG
 @item  @item
 When an argument is given, it  When an argument @var{n} is given, these functions
 sets the precision for @b{bigfloat} operations to @var{n} digits.  set the precision for @b{bigfloat} operations to @var{n} bits or @var{n} digits.
 The return value is always the previous precision in digits regardless of  The return value is always the previous precision regardless of
 the existence of an argument.  the existence of an argument.
   
 @item  @item
 @b{Bigfloat} operations are done by @b{PARI}. (@xref{pari}.)  @b{Bigfloat} operations are done by @b{MPFR} library.
 @item  @item
 This is effective for computations in @b{bigfloat}.  This is effective for computations in @b{bigfloat}.
 Refer to @code{ctrl()} for turning on the `@b{bigfloat} flag.'  Refer to @code{ctrl()} for turning on the `@b{bigfloat} flag.'
Line 1126  Therefore, it is safe to specify a larger value.
Line 1140  Therefore, it is safe to specify a larger value.
   
 @example  @example
 [1] setprec();  [1] setprec();
 9  15
 [2] setprec(100);  [2] setprec(100);
 9  15
 [3] setprec(100);  [3] setprec(100);
 96  99
   [4] setbprec();
   332
 @end example  @end example
   
 @table @t  @table @t
 \JP @item $B;2>H(B  \JP @item $B;2>H(B
 @fref{ctrl}, @fref{eval deval}, @fref{pari}.  @fref{ctrl}, @fref{eval deval}.
 @end table  @end table
   
   \JP @node setround,,, $B?t$N1i;;(B
   \EG @node setround,,, Numbers
   @subsection @code{setround}
   @findex setround
   
   @table @t
   @item setround([@var{mode}])
   \JP :: @b{bigfloat} $B$N4]$a%b!<%I$r(B @var{mode} $B$K@_Dj$9$k(B.
   \EG :: Sets the rounding mode @var{mode}.
   @end table
   
   @table @var
   @item return
   \JP $B@0?t(B
   \EG integer
   @item mode
   \JP $B@0?t(B
   \EG integer
   @end table
   
   @itemize @bullet
   \BJP
   @item
   $B0z?t$,$"$k>l9g(B, @b{bigfloat} $B$N4]$a%b!<%I$r(B @var{mode} $B$K@_Dj$9$k(B.
   $B0z?t$N$"$k$J$7$K$+$+$o$i$:(B, $B0JA0$K@_Dj$5$l$F$$$?CM$rJV$9(B.
   $B4]$a%b!<%I$N0UL#$O<!$N$H$*$j(B.
   @table @code
   @item 0
   Round to nearest
   @item 1
   Round toward 0
   @item 2
   Round toward +infinity
   @item 3
   Round toward -infinity
   @end table
   @item
   @b{bigfloat} $B$G$N7W;;$KBP$7M-8z$G$"$k(B.
   @b{bigfloat} $B$N(B flag $B$r(B on $B$K$9$kJ}K!$O(B, @code{ctrl} $B$r;2>H(B.
   \E
   \BEG
   @item
   When an argument @var{mode} is given, these functions
   set the rounding mode for @b{bigfloat} operations to @var{mode}.
   The return value is always the previous rounding mode regardless of
   the existence of an argument.
   The meanings of rounding modes are as follows
   @table @code
   @item 0
   Round to nearest
   @item 1
   Round toward 0
   @item 2
   Round toward +infinity
   @item 3
   Round toward -infinity
   @end table
   
   @item
   This is effective for computations in @b{bigfloat}.
   Refer to @code{ctrl()} for turning on the `@b{bigfloat} flag.'
   \E
   @end itemize
   
   @example
   [1] setprec();
   15
   [2] setprec(100);
   15
   [3] setprec(100);
   99
   [4] setbprec();
   332
   @end example
   
   @table @t
   \JP @item $B;2>H(B
   @fref{ctrl}, @fref{eval deval}.
   @end table
   
   
 \JP @node setmod,,, $B?t$N1i;;(B  \JP @node setmod,,, $B?t$N1i;;(B
 \EG @node setmod,,, Numbers  \EG @node setmod,,, Numbers

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.11

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