[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.13

version 1.11, 2016/03/22 07:25:14 version 1.13, 2019/03/29 01:57:46
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.12 2016/08/29 04:56:58 noro 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 1080  For details of individual functions, refer to the @b{P
Line 1082  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 1344  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{floor}, @fref{isqrt}.
 @end table  @end table

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

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