aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/BINARY.ht
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
committerdos-reis <gdr@axiomatics.org>2007-08-14 05:14:52 +0000
commitab8cc85adde879fb963c94d15675783f2cf4b183 (patch)
treec202482327f474583b750b2c45dedfc4e4312b1d /src/hyper/pages/BINARY.ht
downloadopen-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz
Initial population.
Diffstat (limited to 'src/hyper/pages/BINARY.ht')
-rw-r--r--src/hyper/pages/BINARY.ht56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/hyper/pages/BINARY.ht b/src/hyper/pages/BINARY.ht
new file mode 100644
index 00000000..e43dce27
--- /dev/null
+++ b/src/hyper/pages/BINARY.ht
@@ -0,0 +1,56 @@
+% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
+% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
+\newcommand{\BinaryExpansionXmpTitle}{BinaryExpansion}
+\newcommand{\BinaryExpansionXmpNumber}{9.4}
+%
+% =====================================================================
+\begin{page}{BinaryExpansionXmpPage}{9.4 BinaryExpansion}
+% =====================================================================
+\beginscroll
+
+All rational numbers have repeating binary expansions.
+Operations to access the individual bits of a binary expansion can
+be obtained by converting the value to \spadtype{RadixExpansion(2)}.
+More examples of expansions are available in
+\downlink{`DecimalExpansion'}{DecimalExpansionXmpPage}\ignore{DecimalExpansion},
+\downlink{`HexadecimalExpansion'}{HexadecimalExpansionXmpPage}\ignore{HexadecimalExpansion}, and
+\downlink{`RadixExpansion'}{RadixExpansionXmpPage}\ignore{RadixExpansion}.
+
+\xtc{
+The expansion (of type \spadtype{BinaryExpansion}) of a rational number
+is returned by the \spadfunFrom{binary}{BinaryExpansion} operation.
+}{
+\spadpaste{r := binary(22/7) \bound{r}}
+}
+\xtc{
+Arithmetic is exact.
+}{
+\spadpaste{r + binary(6/7) \free{r}}
+}
+\xtc{
+The period of the expansion can be short or long \ldots
+}{
+\spadpaste{[binary(1/i) for i in 102..106] }
+}
+\xtc{
+or very long.
+}{
+\spadpaste{binary(1/1007) }
+}
+\xtc{
+These numbers are bona fide algebraic objects.
+}{
+\spadpaste{p := binary(1/4)*x**2 + binary(2/3)*x + binary(4/9) \bound{p}}
+}
+\xtc{
+}{
+\spadpaste{q := D(p, x) \free{p}\bound{q}}
+}
+\xtc{
+}{
+\spadpaste{g := gcd(p, q) \free{p q}\bound{g}}
+}
+\endscroll
+\autobuttons
+\end{page}
+%