version 1.12, 2016/08/29 04:56:58 |
version 1.15, 2020/09/01 09:25:32 |
|
|
@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/num.texi,v 1.11 2016/03/22 07:25:14 noro 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 |
|
|
* lrandom:: |
* lrandom:: |
* ntoint32 int32ton:: |
* ntoint32 int32ton:: |
* setround:: |
* setround:: |
|
* inttorat:: |
@end menu |
@end menu |
|
|
\JP @node idiv irem,,, $B?t$N1i;;(B |
\JP @node idiv irem,,, $B?t$N1i;;(B |
Line 895 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 918 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 1343 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 |