gmp 0.1.9 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.rdoc +4 -4
- data/manual.pdf +0 -0
- data/manual.tex +50 -4
- metadata +2 -2
data/CHANGELOG
CHANGED
data/README.rdoc
CHANGED
@@ -98,7 +98,7 @@ Constructors can take following arguments:
|
|
98
98
|
You can also call them as:
|
99
99
|
GMP.Z(args)
|
100
100
|
GMP.Q(args)
|
101
|
-
|
101
|
+
GMP.F(args)
|
102
102
|
|
103
103
|
=Methods
|
104
104
|
|
@@ -127,11 +127,11 @@ You can also call them as:
|
|
127
127
|
may have different precisions, which would make
|
128
128
|
them unswapable
|
129
129
|
GMP::Z
|
130
|
-
|
131
|
-
|
130
|
+
add! in-place addition
|
131
|
+
sub! in-place subtraction
|
132
132
|
tdiv,fdiv,cdiv truncate, floor and ceil division
|
133
133
|
tmod,fmod,cmod truncate, floor and ceil modulus
|
134
|
-
|
134
|
+
[],[]= testing and setting bits (as booleans)
|
135
135
|
scan0,scan1 starting at bitnr (1st arg), scan for a 0 or 1
|
136
136
|
(respectively), then return the index of the
|
137
137
|
first instance.
|
data/manual.pdf
CHANGED
Binary file
|
data/manual.tex
CHANGED
@@ -24,8 +24,8 @@
|
|
24
24
|
\huge{gmp} &\\
|
25
25
|
\midrule[3pt]
|
26
26
|
\multicolumn{2}{r}{\large{Ruby bindings to the GMP library}}\\
|
27
|
-
\multicolumn{2}{r}{\large{Edition 0.1
|
28
|
-
\multicolumn{2}{r}{\large{
|
27
|
+
\multicolumn{2}{r}{\large{Edition 0.2.1}}\\
|
28
|
+
\multicolumn{2}{r}{\large{21 December 2009}}
|
29
29
|
\end{tabular}
|
30
30
|
|
31
31
|
\vfill
|
@@ -319,6 +319,19 @@ There is also a convenience method available, \texttt{GMP::Z()}.\\
|
|
319
319
|
Returns the difference of \textit{integer} and \textit{numeric}. The destructive method
|
320
320
|
calculates the difference in place. \textit{numeric} can be a member of
|
321
321
|
\textit{GMP::Z}, \textit{Fixnum}, \textit{GMP::Q}, \textit{GMP::F}, or \textit{Bignum}.
|
322
|
+
Here are some examples:\newline
|
323
|
+
|
324
|
+
\texttt{seven = GMP::Z(7) \newline
|
325
|
+
nine \ = GMP::Z(9) \newline
|
326
|
+
half \ = GMP::Q(1,2) \newline
|
327
|
+
pi \quad\ = GMP::F("3.14") \newline
|
328
|
+
nine - 5 \qquad\quad \#=> 4 (GMP Integer) \newline
|
329
|
+
nine - seven \quad \#=> 2 (GMP Integer) \newline
|
330
|
+
nine - (2**32) \#=> -4294967287 (GMP Integer) \newline
|
331
|
+
nine - nine \quad\ \#=> 0 (GMP Integer) \newline
|
332
|
+
nine - half \quad\ \#=> 8.5 (GMP Rational) \newline
|
333
|
+
nine - pi \qquad\ \#=> 5.86 (GMP Float)}
|
334
|
+
|
322
335
|
}
|
323
336
|
\end{tabular}
|
324
337
|
\newline\newline
|
@@ -434,8 +447,6 @@ There is also a convenience method available, \texttt{GMP::Z()}.\\
|
|
434
447
|
}
|
435
448
|
\end{tabular}
|
436
449
|
|
437
|
-
\subsection{Integer Exponentiation}
|
438
|
-
|
439
450
|
\subsection{Integer Roots}
|
440
451
|
|
441
452
|
\begin{tabular}{p{\methwidth} l r}
|
@@ -446,5 +457,40 @@ There is also a convenience method available, \texttt{GMP::Z()}.\\
|
|
446
457
|
Returns the integer part of the \textit{numeric}'th root of \textit{integer}.
|
447
458
|
}
|
448
459
|
\end{tabular}
|
460
|
+
\newline\newline
|
461
|
+
|
462
|
+
\begin{tabular}{p{\methwidth} l r}
|
463
|
+
\toprule
|
464
|
+
\textbf{sqrt} & & \textit{integer}.sqrt $\rightarrow$ \textit{numeric} \\
|
465
|
+
& & \textit{integer}.sqrt!(\textit{numeric}) $\rightarrow$ \textit{numeric} \\
|
466
|
+
\cmidrule(r){2-3}
|
467
|
+
& \multicolumn{2}{p{\defnwidth}}{
|
468
|
+
Returns the truncated integer part of the square root of \textit{integer}.
|
469
|
+
}
|
470
|
+
\end{tabular}
|
471
|
+
\newline\newline
|
472
|
+
|
473
|
+
\begin{tabular}{p{\methwidth} l r}
|
474
|
+
\toprule
|
475
|
+
\textbf{sqrtrem} & & \textit{integer}.sqrtrem $\rightarrow$ \textit{sqrt}, \textit{rem} \\
|
476
|
+
\cmidrule(r){2-3}
|
477
|
+
& \multicolumn{2}{p{\defnwidth}}{
|
478
|
+
Returns the truncated integer part of the square root of \textit{integer} as
|
479
|
+
\textit{sqrt} and the remainder, \textit{integer - sqrt * sqrt}, as \textit{rem}, which
|
480
|
+
will be zero if \textit{integer} is a perfect square.
|
481
|
+
}
|
482
|
+
\end{tabular}
|
483
|
+
|
484
|
+
\subsection{Integer Exponentiation}
|
485
|
+
|
486
|
+
\begin{tabular}{p{\methwidth} l r}
|
487
|
+
\toprule
|
488
|
+
\textbf{**} & & \textit{integer} ** \textit{numeric} $\rightarrow$ \textit{numeric} \\
|
489
|
+
& & \textit{integer}.pow(\textit{numeric}) $\rightarrow$ \textit{numeric} \\
|
490
|
+
\cmidrule(r){2-3}
|
491
|
+
& \multicolumn{2}{p{\defnwidth}}{
|
492
|
+
Returns \textit{integer} raised to the \textit{numeric} power.
|
493
|
+
}
|
494
|
+
\end{tabular}
|
449
495
|
|
450
496
|
\end{document}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Wegrzanowski
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-12-21 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|