[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.11 and 1.15

version 1.11, 2016/03/22 07:25:14 version 1.15, 2020/09/01 09:25:32
Line 1 
Line 1 
 @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/num.texi,v 1.10 2003/12/20 20:02:28 ohara Exp $  @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/num.texi,v 1.14 2020/08/27 11:05:27 takayama 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 22 
Line 22 
 * conj real imag::  * conj real imag::
 * eval deval::  * eval deval::
 * pari::  * pari::
 * setprec::  * setbprec setprec::
 * setmod::  * setmod::
 * lrandom::  * lrandom::
 * ntoint32 int32ton::  * ntoint32 int32ton::
   * setround::
   * inttorat::
 @end menu  @end menu
   
 \JP @node idiv irem,,, $B?t$N1i;;(B  \JP @node idiv irem,,, $B?t$N1i;;(B
Line 756  These functions works also for polynomials with comple
Line 758  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{setbprec}.)  (@xref{setbprec setprec}.)
 @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 799  done by the C math library.
Line 801  done by the C math library.
 When @var{prec} is specified, computation will be performed with a  When @var{prec} is specified, computation will be performed with a
 precision of about @var{prec}-digits.  precision of about @var{prec}-digits.
 If @var{prec} is not specified, computation is performed with the  If @var{prec} is not specified, computation is performed with the
 precision set currently. (@xref{setprec}.)  precision set currently. (@xref{setbprec setprec}.)
 @item  @item
 Currently available numerical functions are listed below.  Currently available numerical functions are listed below.
   
Line 846  Napier's number (@t{exp}(1))
Line 848  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{setbprec}.  @fref{ctrl}, @fref{setbprec setprec}.
 @end table  @end table
   
 \JP @node pari,,, $B?t$N1i;;(B  \JP @node pari,,, $B?t$N1i;;(B
Line 894  Napier's number (@t{exp}(1))
Line 896  Napier's number (@t{exp}(1))
 $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.
 @item  @item
 $B8=;~E@$G<B9T$G$-$k(B @b{PARI} $B$NH!?t$O<!$NDL$j$G$"$k(B. $B$$$:$l$b(B  $B8=;~E@$G<B9T$G$-$k(B @b{PARI} $B$N<g$JH!?t$O<!$NDL$j$G$"$k(B. $B$$$:$l$b(B
 1 $B0z?t$G(B @b{Asir} $B$,BP1~$G$-$k7?$N0z?t$r$H$kH!?t$G$"$k(B.  1 $B0z?t$G(B @b{Asir} $B$,BP1~$G$-$k7?$N0z?t$r$H$kH!?t$G$"$k(B.
   $B<B9T$G$-$kH!?t$NA4%j%9%H$O(B asir-contrib $B$N(B ox_pari $B%^%K%e%"%k$r;2>H(B.
 $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.  $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.
 \E  \E
 \BEG  \BEG
Line 917  for bigfloat operation.
Line 920  for bigfloat operation.
 If the precision is not explicitly specified, operation will be performed  If the precision is not explicitly specified, operation will be performed
 with the precision set by @code{setprec()}.  with the precision set by @code{setprec()}.
 @item  @item
 Currently available functions of @b{PARI} system are as follows.  Some of currently available functions of @b{PARI} system are as follows.
 Note these are only a part of functions in @b{PARI} system.  Note these are only a part of functions in @b{PARI} system.
   A complete list of functions which can be called from asir
   is in the ox_pari manual of the asir-contrib.
 For details of individual functions, refer to the @b{PARI} manual.  For details of individual functions, refer to the @b{PARI} manual.
 (Some of them can be seen in the following example.)  (Some of them can be seen in the following example.)
 \E  \E
Line 1080  For details of individual functions, refer to the @b{P
Line 1085  For details of individual functions, refer to the @b{P
 @table @t  @table @t
 \JP @item $B;2>H(B  \JP @item $B;2>H(B
 \EG @item References  \EG @item References
 @fref{setprec}.  @fref{setbprec setprec}.
 @end table  @end table
   
 \JP @node setbprec setprec,,, $B?t$N1i;;(B  \JP @node setbprec setprec,,, $B?t$N1i;;(B
Line 1342  integer. These functions are used in such a case.
Line 1347  integer. These functions are used in such a case.
 \EG @item References  \EG @item References
 \JP @fref{$BJ,;67W;;(B}, @fref{$B?t$N7?(B}.  \JP @fref{$BJ,;67W;;(B}, @fref{$B?t$N7?(B}.
 \EG @fref{Distributed computation}, @fref{Types of numbers}.  \EG @fref{Distributed computation}, @fref{Types of numbers}.
   @end table
   
   \JP @node inttorat,,, $B?t$N1i;;(B
   \EG @node inttorat,,, Numbers
   @subsection @code{inttorat}
   @findex inttorat
   
   @table @t
   @item inttorat(@var{a},@var{m},@var{b})
   \JP :: $B@0?t(B-$BM-M}?tJQ49$r9T$&(B.
   \EG :: Perform the rational reconstruction.
   @end table
   
   @table @var
   @item return
   \JP $B%j%9%H$^$?$O(B 0
   \EG list or 0
   @item a
   @itemx m
   @itemx b
   \JP $B@0?t(B
   \EG integer
   @end table
   
   @itemize @bullet
   \BJP
   @item
   $B@0?t(B @var{a} $B$KBP$7(B, @var{xa=y} mod @var{m} $B$rK~$?$9@5@0?t(B @var{x}, $B@0?t(B @var{y}
   (@var{x}, @var{|y|} < @var{b}, @var{GCD(x,y)=1}) $B$r5a$a$k(B.
   @item
   $B$3$N$h$&$J(B @var{x}, @var{y} $B$,B8:_$9$k$J$i(B @var{[y,x]} $B$rJV$7(B, $BB8:_$7$J$$>l9g$K$O(B 0 $B$rJV$9(B.
   @item
   @var{b} $B$r(B @var{floor(sqrt(m/2))} $B$H<h$l$P(B, @var{x}, @var{y} $B$OB8:_$9$l$P0l0U$G$"$k(B.
   @var{floor(sqrt(m/2))} $B$O(B @code{isqrt(floor(m/2))} $B$G7W;;$G$-$k(B.
   @end itemize
   \E
   \BEG
   @item
   For an integer @var{a}, find a positive integer @var{x} and an intger @var{y} satisfying
   @var{xa=y} mod @var{m}, @var{x}, @var{|y|} < @var{b} and @var{GCD(x,y)=1}.
   @item
   If such @var{x}, @var{y} exist then a list @var{[y,x]} is returned. Otherwise 0 is returned.
   @item
   If @var{b} is set to @var{floor(sqrt(M/2))}, then @var{x} and @var{y} are unique if they
   exist. @var{floor(sqrt(M/2))} can be computed by @code{floor} and @code{isqrt}.
   @end itemize
   \E
   
   @example
   [2121] M=lprime(0)*lprime(1);
   9996359931312779
   [2122] B=isqrt(floor(M/2));
   70697807
   [2123] A=234234829304;
   234234829304
   [2124] inttorat(A,M,B);
   [-20335178,86975031]
   @end example
   
   @table @t
   \JP @item $B;2>H(B
   \EG @item References
   @fref{ceil floor rint dceil dfloor drint}, @fref{isqrt}.
 @end table  @end table

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

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