home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gmp-2.0.2-diffs.gz / gmp-2.0.2-diffs
Text File  |  1996-10-13  |  140KB  |  3,493 lines

  1. This file contains patches that transform the baseline version into
  2. the amiga version.  Assuming that you have unarchived the baseline
  3. version in the current directory, just run the command:
  4.  
  5.     patch -p1 -E -b .pbak <diff-file
  6.  
  7. where 'diff-file' is this patch file.  After running patch you should
  8. remove all the generated *.pbak files, and look for any *.rej files
  9. that indicate a problem patching the baseline source.
  10.  
  11. diff -rup --new-file baseline/fsf/gmp/Makefile.in amiga/fsf/gmp/Makefile.in
  12. --- baseline/fsf/gmp/Makefile.in    Thu Jun  6 11:21:19 1996
  13. +++ amiga/fsf/gmp/Makefile.in    Sat Sep 28 00:00:00 1996
  14. @@ -25,8 +25,12 @@ prefix = /usr/local
  15.  exec_prefix = $(prefix)
  16.  libdir = $(exec_prefix)/lib
  17.  infodir = $(prefix)/info
  18. +guidedir = $(prefix)/guide
  19. +dvidir = $(prefix)/dvi
  20. +psdir = $(prefix)/ps
  21.  includedir = $(prefix)/include
  22.  
  23. +
  24.  CC = gcc
  25.  LOCAL_CC = $(CC)
  26.  CFLAGS = -g -O
  27. @@ -42,6 +46,8 @@ INSTALL_DATA = $(INSTALL)
  28.  MAKEINFO = makeinfo
  29.  MAKEINFOFLAGS =
  30.  TEXI2DVI = texi2dvi
  31. +TEXI2HTML = texi2html
  32. +DVIPS = dvips
  33.  LN = ln -s
  34.  
  35.  #### host and target specific makefile fragments come in here.
  36. @@ -59,7 +65,7 @@ FILES = gmp.h mp.h gmp-impl.h longlong.h
  37.  INCLUDES = -I. -Impn -I$(srcdir)
  38.  FLAGS_TO_PASS = "CC=$(CC)" "CFLAGS=$(CFLAGS)" "XCFLAGS=$(XCFLAGS)"
  39.  
  40. -all: libgmp.a
  41. +all: libgmp.a libmp.a info dvi ps guide # html
  42.  
  43.  .c.o:
  44.      $(CC) -c $(INCLUDES) $(CFLAGS) $(XCFLAGS) $<
  45. @@ -110,34 +116,44 @@ check: libgmp.a
  46.  
  47.  doc: gmp.dvi gmp.info
  48.  
  49. -info: $(srcdir)/gmp.info
  50. -$(srcdir)/gmp.info: $(srcdir)/gmp.texi
  51. -    cd $(srcdir); $(MAKEINFO) gmp.texi
  52. +info: gmp.info
  53. +gmp.info: gmp.texi
  54. +    $(MAKEINFO) -I$(srcdir) $(srcdir)/gmp.texi --no-split --output=$@
  55. +
  56. +guide: gmp.guide
  57. +gmp.guide: gmp.texi
  58. +    $(MAKEINFO) -I$(srcdir) $(srcdir)/gmp.texi --no-split --output=$@ --amiga
  59.  
  60.  dvi: gmp.dvi
  61. -gmp.dvi: $(srcdir)/gmp.texi
  62. -    rm -f tmp.texi
  63. -    $(LN) $(srcdir)/gmp.texi tmp.texi
  64. -    TEXINPUTS=.:$(srcdir) $(TEXI2DVI) tmp.texi
  65. -    rm -f tmp.texi
  66. -    mv tmp.dvi gmp.dvi
  67. -    rm -f tmp.*
  68. +gmp.dvi: gmp.texi
  69. +    TEXINPUTS=.:$(srcdir) $(TEXI2DVI) $(srcdir)/gmp.texi
  70.  
  71.  ps: gmp.ps
  72.  gmp.ps: gmp.dvi
  73. -    dvips gmp.dvi -o gmp.ps
  74. +    $(DVIPS) -o $@ $?
  75.  
  76.  html: gmp_toc.html
  77. -gmp_toc.html: $(srcdir)/gmp.texi
  78. -    texi2html -acc -split_chapter $(srcdir)/gmp.texi
  79. +gmp_toc.html: gmp.texi
  80. +    $(TEXI2HTML) -acc -split_chapter $(srcdir)/gmp.texi
  81.  
  82.  # The semicolon is to prevent the install.sh -> install default rule
  83.  # from doing anything.  Having it run true helps avoid problems and
  84.  # noise from versions of make which don't like to have null commands.
  85. -install: install-normal ; @true
  86. +install: install-all ; @true
  87.  
  88.  install-strip: install-normal
  89. -install-normal: installdirs libgmp.a gmp.info install-info-files
  90. +install-all: installdirs libgmp.a libmp.a gmp.info install-info-files \
  91. +    install-dvi-files install-ps-files install-guide-files
  92. +    $(INSTALL_DATA) libgmp.a $(libdir)/libgmp.a
  93. +    -chmod a-x $(libdir)/libgmp.a
  94. +    $(INSTALL_DATA) $(srcdir)/gmp.h $(includedir)/gmp.h
  95. +    -chmod a-x $(includedir)/gmp.h
  96. +    $(INSTALL_DATA) libmp.a $(libdir)/libmp.a
  97. +    -chmod a-x $(libdir)/libmp.a
  98. +    $(INSTALL_DATA) $(srcdir)/mp.h $(includedir)/mp.h
  99. +    -chmod a-x $(includedir)/mp.h
  100. +install-normal: installdirs libgmp.a gmp.info install-info-files \
  101. +    install-dvi-files install-ps-files install-guide-files
  102.      $(INSTALL_DATA) libgmp.a $(libdir)/libgmp.a
  103.      -chmod a-x $(libdir)/libgmp.a
  104.      $(INSTALL_DATA) $(srcdir)/gmp.h $(includedir)/gmp.h
  105. @@ -147,17 +163,27 @@ install-bsdmp: installdirs libmp.a gmp.i
  106.      -chmod a-x $(libdir)/libmp.a
  107.      $(INSTALL_DATA) $(srcdir)/mp.h $(includedir)/mp.h
  108.      -chmod a-x $(includedir)/mp.h
  109. -install-info-files: installdirs $(srcdir)/gmp.info
  110. -    cd $(srcdir); for f in gmp.info*; \
  111. +install-info-files: installdirs gmp.info
  112. +    for f in gmp.info*; \
  113.      do $(INSTALL_DATA) $$f $(infodir)/$$f; done
  114.      -chmod a-x $(infodir)/gmp.info*
  115.      # Attempt to edit the info directory node
  116.      if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
  117.        install-info --dir-file=$(infodir)/dir $(infodir)/gmp.info; \
  118.        else true; fi
  119. +install-dvi-files: installdirs gmp.dvi
  120. +    $(INSTALL_DATA) gmp.dvi $(dvidir)/gmp.dvi
  121. +    -chmod a-x $(dvidir)/gmp.dvi
  122. +install-ps-files: installdirs gmp.ps
  123. +    $(INSTALL_DATA) gmp.ps $(psdir)/gmp.ps
  124. +    -chmod a-x $(psdir)/gmp.ps
  125. +install-guide-files: installdirs gmp.guide
  126. +    $(INSTALL_DATA) gmp.guide $(guidedir)/gmp.guide
  127. +    -chmod a-x $(guidedir)/gmp.guide
  128.  
  129.  installdirs: $(srcdir)/mkinstalldirs
  130. -    $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(infodir)
  131. +    $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(infodir) \
  132. +        $(psdir) $(guidedir) $(dvidir)
  133.  
  134.  uninstall:
  135.      rm -f $(libdir)/libgmp.a
  136. @@ -169,6 +195,7 @@ uninstall:
  137.  clean mostlyclean:
  138.      rm -f *.o libgmp.a libmp.a gmp.dvi gmp.ps tmp.* tmp-*
  139.      rm -f gmp.?? gmp.??s gmp.log gmp.toc gmp.*aux gmp*.html
  140. +    rm -f gmp.guide
  141.      -cd mpn; $(MAKE) $@
  142.      -cd mpz; $(MAKE) $@
  143.      -cd mpf; $(MAKE) $@
  144. @@ -182,7 +209,7 @@ distclean: clean
  145.      -cd mpq; $(MAKE) $@
  146.      -cd mpbsd; $(MAKE) $@
  147.  maintainer-clean: distclean
  148. -    rm -f $(srcdir)/gmp.info*
  149. +    rm -f gmp.info*
  150.  
  151.  TAGS: force
  152.      cd $(srcdir); etags *.[ch] mp*/*.c mpn/generic/*.c >TAGS
  153. diff -rup --new-file baseline/fsf/gmp/Product-Info amiga/fsf/gmp/Product-Info
  154. --- baseline/fsf/gmp/Product-Info    Wed Dec 31 17:00:00 1969
  155. +++ amiga/fsf/gmp/Product-Info    Sat Sep 28 00:00:00 1996
  156. @@ -0,0 +1,33 @@
  157. +.name
  158. +gmp
  159. +.fullname
  160. +GNU arbitrary precision arithmetic library
  161. +.type
  162. +Library
  163. +.short
  164. +Arbitrary precision math library.
  165. +.description
  166. +GNU MP is a library for arbitrary precision arithmetic, operating on
  167. +signed integers and rational numbers.  It has a rich set of functions,
  168. +and the functions have a regular interface.
  169. +
  170. +The author has tried to make these functions as fast as possible, both
  171. +for small operands and for huge operands.  The speed is achieved by
  172. +using fullwords as the basic arithmetic type, by using fast
  173. +algorithms, by defining inline assembler for mixed sized
  174. +multiplication and division (i.e 32*32->64 bit multiplication and
  175. +64/32->32,32 bit division), and by hacking the code with emphasis on
  176. +speed (and not simplicity and elegance).
  177. +
  178. +The speed of GNU MP is about 5 to 100 times that of Berkeley MP for
  179. +small operands.  The speed-up increases with the operand sizes for
  180. +certain operations, for which GNU MP has asymptotically faster
  181. +algorithms.
  182. +.version
  183. +2.0.2
  184. +.author
  185. +Torbjorn Granlund
  186. +.distribution
  187. +GNU Public License
  188. +.described-by
  189. +Fred Fish (fnf@amigalib.com)
  190. diff -rup --new-file baseline/fsf/gmp/config.sub amiga/fsf/gmp/config.sub
  191. --- baseline/fsf/gmp/config.sub    Fri May 10 08:39:12 1996
  192. +++ amiga/fsf/gmp/config.sub    Sat Sep 28 00:00:00 1996
  193. @@ -213,11 +213,11 @@ case $basic_machine in
  194.          os=-sysv
  195.          ;;
  196.      amiga | amiga-*)
  197. -        basic_machine=m68k-cbm
  198. +        basic_machine=m68k-unknown
  199.          ;;
  200. -    amigados)
  201. -        basic_machine=m68k-cbm
  202. -        os=-amigados
  203. +    amigaos)
  204. +        basic_machine=m68k-unknown
  205. +        os=-amigaos
  206.          ;;
  207.      amigaunix | amix)
  208.          basic_machine=m68k-cbm
  209. @@ -816,7 +816,7 @@ case $os in
  210.      -gnu* | -bsd* | -mach* | -lites* | -minix* | -genix* | -ultrix* | -irix* \
  211.            | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \
  212.            | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  213. -          | -amigados* | -msdos* | -moss* | -newsos* | -unicos* | -aos* \
  214. +          | -amigaos* | -msdos* | -moss* | -newsos* | -unicos* | -aos* \
  215.            | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
  216.            | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
  217.            | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix*  | -lites* \
  218. @@ -970,7 +970,7 @@ case $basic_machine in
  219.          os=-sysv
  220.          ;;
  221.      *-cbm)
  222. -        os=-amigados
  223. +        os=-amigaos
  224.          ;;
  225.      *-dg)
  226.          os=-dgux
  227. diff -rup --new-file baseline/fsf/gmp/configure amiga/fsf/gmp/configure
  228. --- baseline/fsf/gmp/configure    Thu Jun  6 11:25:33 1996
  229. +++ amiga/fsf/gmp/configure    Sat Sep 28 00:00:00 1996
  230. @@ -61,7 +61,7 @@ moveifchange=
  231.  norecursion=
  232.  other_options=
  233.  package_makefile_frag=
  234. -prefix=/usr/local
  235. +prefix=/ade
  236.  progname=
  237.  program_prefix=
  238.  program_prefixoption=
  239. @@ -80,7 +80,7 @@ subdirs=
  240.  target_alias=NOTARGET
  241.  target_makefile_frag=
  242.  undefs=NOUNDEFS
  243. -version="$Revision: 1.218 (modified for gmp) $"
  244. +version="$Revision: 1.222.4.1 $"
  245.  x11=default
  246.  
  247.  ### we might need to use some other shell than /bin/sh for running subshells
  248. @@ -100,7 +100,8 @@ NO_EDIT="This file was generated automat
  249.  
  250.  progname=$0
  251.  # if PWD already has a value, it is probably wrong.
  252. -if [ -n "$PWD" ]; then PWD=`pwd`; fi
  253. +# The AmigaOS pdksh can't change the value of PWD, it's readonly.
  254. +# if [ -n "$PWD" ]; then PWD=`pwd`; fi
  255.  
  256.  case "${progname}" in
  257.  /*) ;;
  258. @@ -180,8 +181,8 @@ do
  259.          esac
  260.  
  261.          enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
  262. -        eval $enableopt="$optarg"
  263. -        enableoptions="$enableoptions $option"
  264. +        eval "$enableopt='$optarg'"
  265. +        enableoptions="$enableoptions '$option'"
  266.          ;;
  267.      --exec-prefix* | --ex*)
  268.          exec_prefix=$optarg
  269. @@ -690,6 +691,44 @@ s/\\\n//g
  270.    rm -f Makefile.cc
  271.  fi
  272.  
  273. +# Generate a default definition for YACC.  This is used if the makefile can't
  274. +# locate bison or byacc in objdir.
  275. +
  276. +for prog in 'bison -y' byacc yacc
  277. +do
  278. +  set dummy $prog; tmp=$2
  279. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  280. +  for dir in $PATH; do
  281. +    test -z "$dir" && dir=.
  282. +    if test -f $dir/$tmp; then
  283. +      DEFAULT_YACC="$prog"
  284. +      break
  285. +    fi
  286. +  done
  287. +  IFS="$save_ifs"
  288. +
  289. +  test -n "$DEFAULT_YACC" && break
  290. +done
  291. +
  292. +# Generate a default definition for LEX.  This is used if the makefile can't
  293. +# locate flex in objdir.
  294. +
  295. +for prog in flex lex
  296. +do
  297. +  set dummy $prog; tmp=$2
  298. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  299. +  for dir in $PATH; do
  300. +    test -z "$dir" && dir=.
  301. +    if test -f $dir/$tmp; then
  302. +      DEFAULT_LEX="$prog"
  303. +      break
  304. +    fi
  305. +  done
  306. +  IFS="$save_ifs"
  307. +
  308. +  test -n "$DEFAULT_LEX" && break
  309. +done
  310. +
  311.  if [ "${build}" != "${host}" ]; then
  312.    # If we are doing a Canadian Cross, in which the host and build systems
  313.    # are not the same, we set reasonable default values for the tools.
  314. @@ -785,7 +824,7 @@ s/\\\n//g
  315.    export RANLIB
  316.  else
  317.    # If CC is still not set, try to get gcc.
  318. -  if [ x$with_gcc != xno -a -z "${CC}" ]; then
  319. +  if [ -z "${CC}" ]; then
  320.      IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  321.      for dir in $PATH; do
  322.        test -z "$dir" && dir=.
  323. @@ -1087,6 +1126,8 @@ EOF
  324.                      -e "s:^program_suffix[     ]*=.*$:program_suffix = ${program_suffix}:" \
  325.                      -e "s:^program_transform_name[     ]*=.*$:program_transform_name = ${program_transform_name}:" \
  326.                      -e "s:^tooldir[     ]*=.*$:tooldir = ${tooldir}:" \
  327. +            -e "s:^DEFAULT_YACC[     ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
  328. +            -e "s:^DEFAULT_LEX[     ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
  329.                      ${subdir}/Makefile.tem >> ${Makefile}
  330.  
  331.          # If this is a Canadian Cross, preset the values of many more
  332. diff -rup --new-file baseline/fsf/gmp/gmp.info amiga/fsf/gmp/gmp.info
  333. --- baseline/fsf/gmp/gmp.info    Thu Jun  6 12:30:58 1996
  334. +++ amiga/fsf/gmp/gmp.info    Wed Dec 31 17:00:00 1969
  335. @@ -1,75 +0,0 @@
  336. -This is Info file gmp.info, produced by Makeinfo-1.64 from the input
  337. -file gmp.texi.
  338. -
  339. -START-INFO-DIR-ENTRY
  340. -* gmp: (gmp.info).               GNU Multiple Precision Arithmetic Library.
  341. -END-INFO-DIR-ENTRY
  342. -
  343. -   This file documents GNU MP, a library for arbitrary-precision
  344. -arithmetic.
  345. -
  346. -   Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation,
  347. -Inc.
  348. -
  349. -   Permission is granted to make and distribute verbatim copies of this
  350. -manual provided the copyright notice and this permission notice are
  351. -preserved on all copies.
  352. -
  353. -   Permission is granted to copy and distribute modified versions of
  354. -this manual under the conditions for verbatim copying, provided that
  355. -the entire resulting derived work is distributed under the terms of a
  356. -permission notice identical to this one.
  357. -
  358. -   Permission is granted to copy and distribute translations of this
  359. -manual into another language, under the above conditions for modified
  360. -versions, except that this permission notice may be stated in a
  361. -translation approved by the Foundation.
  362. -
  363. -
  364. -Indirect:
  365. -gmp.info-1: 1018
  366. -gmp.info-2: 50874
  367. -gmp.info-3: 94190
  368. -
  369. -Tag Table:
  370. -(Indirect)
  371. -Node: Top1018
  372. -Node: Copying2028
  373. -Node: Introduction to MP3728
  374. -Node: Installing MP5657
  375. -Node: MP Basics10220
  376. -Node: Reporting Bugs16508
  377. -Node: Integer Functions18028
  378. -Node: Initializing Integers18635
  379. -Node: Assigning Integers20751
  380. -Node: Simultaneous Integer Init & Assign22026
  381. -Node: Converting Integers23640
  382. -Node: Integer Arithmetic25309
  383. -Node: Comparison Functions36185
  384. -Node: Integer Logic and Bit Fiddling37087
  385. -Node: I/O of Integers39148
  386. -Node: Miscellaneous Integer Functions41629
  387. -Node: Rational Number Functions43299
  388. -Node: Initializing Rationals44594
  389. -Node: Assigning Rationals45764
  390. -Node: Comparing Rationals46727
  391. -Node: Applying Integer Functions48010
  392. -Node: Miscellaneous Rational Functions48828
  393. -Node: Floating-point Functions50874
  394. -Node: Initializing Floats52722
  395. -Node: Assigning Floats55474
  396. -Node: Simultaneous Float Init & Assign57066
  397. -Node: Converting Floats58583
  398. -Node: Float Arithmetic60162
  399. -Node: Float Comparison62071
  400. -Node: I/O of Floats63097
  401. -Node: Miscellaneous Float Functions65213
  402. -Node: Low-level Functions65896
  403. -Node: BSD Compatible Functions82264
  404. -Node: Custom Allocation86600
  405. -Node: Contributors88938
  406. -Node: References90537
  407. -Node: Concept Index91573
  408. -Node: Function Index94190
  409. -
  410. -End Tag Table
  411. diff -rup --new-file baseline/fsf/gmp/gmp.info-1 amiga/fsf/gmp/gmp.info-1
  412. --- baseline/fsf/gmp/gmp.info-1    Thu Jun  6 12:30:58 1996
  413. +++ amiga/fsf/gmp/gmp.info-1    Wed Dec 31 17:00:00 1969
  414. @@ -1,1283 +0,0 @@
  415. -This is Info file gmp.info, produced by Makeinfo-1.64 from the input
  416. -file gmp.texi.
  417. -
  418. -START-INFO-DIR-ENTRY
  419. -* gmp: (gmp.info).               GNU Multiple Precision Arithmetic Library.
  420. -END-INFO-DIR-ENTRY
  421. -
  422. -   This file documents GNU MP, a library for arbitrary-precision
  423. -arithmetic.
  424. -
  425. -   Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation,
  426. -Inc.
  427. -
  428. -   Permission is granted to make and distribute verbatim copies of this
  429. -manual provided the copyright notice and this permission notice are
  430. -preserved on all copies.
  431. -
  432. -   Permission is granted to copy and distribute modified versions of
  433. -this manual under the conditions for verbatim copying, provided that
  434. -the entire resulting derived work is distributed under the terms of a
  435. -permission notice identical to this one.
  436. -
  437. -   Permission is granted to copy and distribute translations of this
  438. -manual into another language, under the above conditions for modified
  439. -versions, except that this permission notice may be stated in a
  440. -translation approved by the Foundation.
  441. -
  442. -
  443. -File: gmp.info,  Node: Top,  Next: Copying,  Prev: (dir),  Up: (dir)
  444. -
  445. -GNU MP
  446. -******
  447. -
  448. -   This manual documents how to install and use the GNU multiple
  449. -precision arithmetic library, version 2.0.2.
  450. -
  451. -* Menu:
  452. -
  453. -* Copying::                   GMP Copying Conditions (LGPL).
  454. -* Introduction to MP::        Brief introduction to GNU MP.
  455. -* Installing MP::             How to configure and compile the MP library.
  456. -* MP Basics::                 What every MP user should now.
  457. -* Reporting Bugs::            How to usefully report bugs.
  458. -* Integer Functions::         Functions for arithmetic on signed integers.
  459. -* Rational Number Functions:: Functions for arithmetic on rational numbers.
  460. -* Floating-point Functions::  Functions for arithmetic on floats.
  461. -* Low-level Functions::       Fast functions for natural numbers.
  462. -* BSD Compatible Functions::  All functions found in BSD MP.
  463. -* Custom Allocation::         How to customize the internal allocation.
  464. -
  465. -* Contributors::
  466. -* References::
  467. -* Concept Index::
  468. -* Function Index::
  469. -
  470. -
  471. -File: gmp.info,  Node: Copying,  Next: Introduction to MP,  Prev: Top,  Up: Top
  472. -
  473. -GNU MP Copying Conditions
  474. -*************************
  475. -
  476. -   This library is "free"; this means that everyone is free to use it
  477. -and free to redistribute it on a free basis.  The library is not in the
  478. -public domain; it is copyrighted and there are restrictions on its
  479. -distribution, but these restrictions are designed to permit everything
  480. -that a good cooperating citizen would want to do.  What is not allowed
  481. -is to try to prevent others from further sharing any version of this
  482. -library that they might get from you.
  483. -
  484. -   Specifically, we want to make sure that you have the right to give
  485. -away copies of the library, that you receive source code or else can
  486. -get it if you want it, that you can change this library or use pieces
  487. -of it in new free programs, and that you know you can do these things.
  488. -
  489. -   To make sure that everyone has such rights, we have to forbid you to
  490. -deprive anyone else of these rights.  For example, if you distribute
  491. -copies of the GNU MP library, you must give the recipients all the
  492. -rights that you have.  You must make sure that they, too, receive or
  493. -can get the source code.  And you must tell them their rights.
  494. -
  495. -   Also, for our own protection, we must make certain that everyone
  496. -finds out that there is no warranty for the GNU MP library.  If it is
  497. -modified by someone else and passed on, we want their recipients to
  498. -know that what they have is not what we distributed, so that any
  499. -problems introduced by others will not reflect on our reputation.
  500. -
  501. -   The precise conditions of the license for the GNU MP library are
  502. -found in the Library General Public License that accompany the source
  503. -code.
  504. -
  505. -
  506. -File: gmp.info,  Node: Introduction to MP,  Next: Installing MP,  Prev: Copying,  Up: Top
  507. -
  508. -Introduction to GNU MP
  509. -**********************
  510. -
  511. -   GNU MP is a portable library written in C for arbitrary precision
  512. -arithmetic on integers, rational numbers, and floating-point numbers.
  513. -It aims to provide the fastest possible arithmetic for all applications
  514. -that need higher precision than is directly supported by the basic C
  515. -types.
  516. -
  517. -   Many applications use just a few hundred bits of precision; but some
  518. -applications may need thousands or even millions of bits.  MP is
  519. -designed to give good performance for both, by choosing algorithms
  520. -based on the sizes of the operands, and by carefully keeping the
  521. -overhead at a minimum.
  522. -
  523. -   The speed of MP is achieved by using fullwords as the basic
  524. -arithmetic type, by using sophisticated algorithms, by including
  525. -carefully optimized assembly code for the most common inner loops for
  526. -many different CPUs, and by a general emphasis on speed (as opposed to
  527. -simplicity or elegance).
  528. -
  529. -   There is carefully optimized assembly code for these CPUs: DEC
  530. -Alpha, Amd 29000, HPPA 1.0 and 1.1, Intel Pentium and generic x86,
  531. -Intel i960, Motorola MC68000, MC68020, MC88100, and MC88110,
  532. -Motorola/IBM PowerPC, National NS32000, IBM POWER, MIPS R3000, R4000,
  533. -SPARCv7, SuperSPARC, generic SPARCv8, and DEC VAX.  Some optimizations
  534. -also for ARM, Clipper, IBM ROMP (RT), and Pyramid AP/XP.
  535. -
  536. -   This version of MP is released under a more liberal license than
  537. -previous versions.  It is now permitted to link MP to non-free
  538. -programs, as long as MP source code is provided when distributing the
  539. -non-free program.
  540. -
  541. -How to use this Manual
  542. -======================
  543. -
  544. -   Everyone should read *Note MP Basics::.  If you need to install the
  545. -library yourself, you need to read *Note Installing MP::, too.
  546. -
  547. -   The rest of the manual can be used for later reference, although it
  548. -is probably a good idea to glance through it.
  549. -
  550. -
  551. -File: gmp.info,  Node: Installing MP,  Next: MP Basics,  Prev: Introduction to MP,  Up: Top
  552. -
  553. -Installing MP
  554. -*************
  555. -
  556. -   To build MP, you first have to configure it for your CPU and
  557. -operating system.  You need a C compiler, preferably GCC, but any
  558. -reasonable compiler should work.  And you need a standard Unix `make'
  559. -program, plus some other standard Unix utility programs.
  560. -
  561. -   (If you're on an MS-DOS machine, your can build MP using `make.bat'.
  562. -It requires that djgpp is installed.  It does not require
  563. -configuration, nor is `make' needed; `make.bat' both configures and
  564. -builds the library.)
  565. -
  566. -   Here are the steps needed to install the library on Unix systems:
  567. -
  568. -  1. In most cases, `./configure --target=cpu-vendor-os', should work
  569. -     both for native and cross-compilation.  If you get error messages,
  570. -     your machine might not be supported.
  571. -
  572. -     If you want to compile in a separate object directory, cd to that
  573. -     directory, and prefix the configure command with the path to the
  574. -     MP source directory.  Not all `make' programs have the necessary
  575. -     features to support this.  In particular, SunOS and Slowaris
  576. -     `make' have bugs that makes them unable to build from a separate
  577. -     object directory.  Use GNU `make' instead.
  578. -
  579. -     In addition to the standard cpu-vendor-os tuples, MP recognizes
  580. -     sparc8 and supersparc as valid CPU names.  Specifying these CPU
  581. -     names for relevant systems will improve performance significantly.
  582. -
  583. -     In general, if you want a library that runs as fast as possible,
  584. -     you should make sure you configure MP for the exact CPU type your
  585. -     system uses.
  586. -
  587. -     If you have `gcc' in your `PATH', it will be used by default.  To
  588. -     override this, pass `-with-gcc=no' to `configure'.
  589. -
  590. -  2. `make'
  591. -
  592. -     This will compile MP, and create a library archive file `libgmp.a'
  593. -     in the working directory.
  594. -
  595. -  3. `make check'
  596. -
  597. -     This will make sure MP was built correctly.  If you get error
  598. -     messages, please report this to `bug-gmp@prep.ai.mit.edu'.  (*Note
  599. -     Reporting Bugs::, for information on what to include in useful bug
  600. -     reports.)
  601. -
  602. -  4. `make install'
  603. -
  604. -     This will copy the file `gmp.h' and `libgmp.a', as well as the info
  605. -     files, to `/usr/local' (or if you passed the `--prefix' option to
  606. -     `configure', to the directory given as argument to `--prefix').
  607. -
  608. -If you wish to build and install the BSD MP compatible functions, use
  609. -`make libmp.a' and `make install-bsdmp'.
  610. -
  611. -   There are some other useful make targets:
  612. -
  613. -   * `doc'
  614. -
  615. -     Create a DVI version of the manual, in `gmp.dvi' and a set of info
  616. -     files, in `gmp.info', `gmp.info-1', `gmp.info-2', etc.
  617. -
  618. -   * `ps'
  619. -
  620. -     Create a Postscript version of the manual, in `gmp.ps'.
  621. -
  622. -   * `html'
  623. -
  624. -     Create a HTML version of the manual, in `gmp.html'.
  625. -
  626. -   * `clean'
  627. -
  628. -     Delete all object files and archive files, but not the
  629. -     configuration files.
  630. -
  631. -   * `distclean'
  632. -
  633. -     Delete all files not included in the distribution.
  634. -
  635. -   * `uninstall'
  636. -
  637. -     Delete all files copied by `make install'.
  638. -
  639. -Known Build Problems
  640. -====================
  641. -
  642. -   GCC 2.7.2 (as well as 2.6.3) for the RS/6000 and PowerPC can not be
  643. -used to compile MP, due to a bug in GCC.  If you want to use GCC for
  644. -these machines, you need to apply the patch below to GCC, or use a
  645. -later version of the compiler.
  646. -
  647. -   If you are on a Sequent Symmetry, use the GNU assembler instead of
  648. -the system's assembler, since the latter has serious bugs.
  649. -
  650. -   The system compiler on NeXT is a massacred and old gcc, even if the
  651. -compiler calls itself `cc'.  This compiler cannot be used to build MP.
  652. -You need to get a real gcc, and install that before you compile MP.
  653. -(NeXT might have fixed this in newer releases of their system.)
  654. -
  655. -   The system C compiler under SunOS 4 has a bug that makes it
  656. -miscompile mpq/get_d.c.  This will make `make check' fail.
  657. -
  658. -   Please report other problems to `bug-gmp@prep.ai.mit.edu'.  *Note
  659. -Reporting Bugs::.
  660. -
  661. -   Patch to apply to GCC 2.6.3 and 2.7.2:
  662. -
  663. -     *** config/rs6000/rs6000.md    Sun Feb 11 08:22:11 1996
  664. -     --- config/rs6000/rs6000.md.new    Sun Feb 18 03:33:37 1996
  665. -     ***************
  666. -     *** 920,926 ****
  667. -          (set (match_operand:SI 0 "gpc_reg_operand" "=r")
  668. -           (not:SI (match_dup 1)))]
  669. -         ""
  670. -     !   "nor. %0,%2,%1"
  671. -         [(set_attr "type" "compare")])
  672. -     
  673. -       (define_insn ""
  674. -     --- 920,926 ----
  675. -          (set (match_operand:SI 0 "gpc_reg_operand" "=r")
  676. -           (not:SI (match_dup 1)))]
  677. -         ""
  678. -     !   "nor. %0,%1,%1"
  679. -         [(set_attr "type" "compare")])
  680. -     
  681. -       (define_insn ""
  682. -
  683. -
  684. -File: gmp.info,  Node: MP Basics,  Next: Reporting Bugs,  Prev: Installing MP,  Up: Top
  685. -
  686. -MP Basics
  687. -*********
  688. -
  689. -   All declarations needed to use MP are collected in the include file
  690. -`gmp.h'.  It is designed to work with both C and C++ compilers.
  691. -
  692. -Nomenclature and Types
  693. -======================
  694. -
  695. -In this manual, "integer" usually means a multiple precision integer, as
  696. -defined by the MP library.  The C data type for such integers is
  697. -`mpz_t'.  Here are some examples of how to declare such integers:
  698. -
  699. -     mpz_t sum;
  700. -     
  701. -     struct foo { mpz_t x, y; };
  702. -     
  703. -     mpz_t vec[20];
  704. -
  705. -"Rational number" means a multiple precision fraction.  The C data type
  706. -for these fractions is `mpq_t'.  For example:
  707. -
  708. -     mpq_t quotient;
  709. -
  710. -"Floating point number" or "Float" for short, is an arbitrary precision
  711. -mantissa with an limited precision exponent.  The C data type for such
  712. -objects is `mpf_t'.
  713. -
  714. -A "limb" means the part of a multi-precision number that fits in a
  715. -single word.  (We chose this word because a limb of the human body is
  716. -analogous to a digit, only larger, and containing several digits.)
  717. -Normally a limb contains 32 or 64 bits.  The C data type for a limb is
  718. -`mp_limb_t'.
  719. -
  720. -Function Classes
  721. -================
  722. -
  723. -   There are six classes of functions in the MP library:
  724. -
  725. -  1. Functions for signed integer arithmetic, with names beginning with
  726. -     `mpz_'.  The associated type is `mpz_t'.  There are about 100
  727. -     functions in this class.
  728. -
  729. -  2. Functions for rational number arithmetic, with names beginning with
  730. -     `mpq_'.  The associated type is `mpq_t'.  There are about 20
  731. -     functions in this class, but the functions in the previous class
  732. -     can be used for performing arithmetic on the numerator and
  733. -     denominator separately.
  734. -
  735. -  3. Functions for floating-point arithmetic, with names beginning with
  736. -     `mpf_'.  The associated type is `mpf_t'.  There are about 50
  737. -     functions is this class.
  738. -
  739. -  4. Functions compatible with Berkeley MP, such as `itom', `madd', and
  740. -     `mult'.  The associated type is `MINT'.
  741. -
  742. -  5. Fast low-level functions that operate on natural numbers.  These
  743. -     are used by the functions in the preceding groups, and you can
  744. -     also call them directly from very time-critical user programs.
  745. -     These functions' names begin with `mpn_'.  There are about 30
  746. -     (hard-to-use) functions in this class.
  747. -
  748. -     The associated type is array of `mp_limb_t'.
  749. -
  750. -  6. Miscellaneous functions.  Functions for setting up custom
  751. -     allocation.
  752. -
  753. -MP Variable Conventions
  754. -=======================
  755. -
  756. -   As a general rule, all MP functions expect output arguments before
  757. -input arguments.  This notation is based on an analogy with the
  758. -assignment operator.  (The BSD MP compatibility functions disobey this
  759. -rule, having the output argument(s) last.)
  760. -
  761. -   MP allows you to use the same variable for both input and output in
  762. -the same expression.  For example, the main function for integer
  763. -multiplication, `mpz_mul', can be used like this: `mpz_mul (x, x, x)'.
  764. -This computes the square of X and puts the result back in X.
  765. -
  766. -   Before you can assign to an MP variable, you need to initialize it
  767. -by calling one of the special initialization functions.  When you're
  768. -done with a variable, you need to clear it out, using one of the
  769. -functions for that purpose.  Which function to use depends on the type
  770. -of variable.  See the chapters on integer functions, rational number
  771. -functions, and floating-point functions for details.
  772. -
  773. -   A variable should only be initialized once, or at least cleared out
  774. -between each initialization.  After a variable has been initialized, it
  775. -may be assigned to any number of times.
  776. -
  777. -   For efficiency reasons, avoid to initialize and clear out a variable
  778. -in loops.  Instead, initialize it before entering the loop, and clear
  779. -it out after the loop has exited.
  780. -
  781. -   You don't need to be concerned about allocating additional space for
  782. -MP variables.  All functions in MP automatically allocate additional
  783. -space when a variable does not already have enough space.  They do not,
  784. -however, reduce the space when a smaller number is stored in the
  785. -object.  Most of the time, this policy is best, since it avoids
  786. -frequent re-allocation.
  787. -
  788. -Useful Macros and Constants
  789. -===========================
  790. -
  791. - - Global Constant: const int mp_bits_per_limb
  792. -     The number of bits per limb.
  793. -
  794. - - Macro: __GNU_MP_VERSION
  795. - - Macro: __GNU_MP_VERSION_MINOR
  796. -     The major and minor MP version, respectively, as integers.
  797. -
  798. -Compatibility with Version 1.x
  799. -==============================
  800. -
  801. -   This version of MP is upward compatible with previous versions of
  802. -MP, with a few exceptions.
  803. -
  804. -  1. Integer division functions round the result differently.  The old
  805. -     functions (`mpz_div', `mpz_divmod', `mpz_mdiv', `mpz_mdivmod',
  806. -     etc) now all use floor rounding (i.e., they round the quotient to
  807. -     -infinity).  There are a lot of new functions for integer
  808. -     division, giving the user better control over the rounding.
  809. -
  810. -  2. The function `mpz_mod' now compute the true *mod* function.
  811. -
  812. -  3. The functions `mpz_powm' and `mpz_powm_ui' now use *mod* for
  813. -     reduction.
  814. -
  815. -  4. The assignment functions for rational numbers do no longer
  816. -     canonicalize their results.  In the case a non-canonical result
  817. -     could arise from an assignment, the user need to insert an
  818. -     explicit call to `mpq_canonicalize'.  This change was made for
  819. -     efficiency.
  820. -
  821. -  5. Output generated by `mpz_out_raw' in this release cannot be read
  822. -     by `mpz_inp_raw' in previous releases.  This change was made for
  823. -     making the file format truly portable between machines with
  824. -     different word sizes.
  825. -
  826. -  6. Several `mpn' functions have changed.  But they were intentionally
  827. -     undocumented in previous releases.
  828. -
  829. -  7. The functions `mpz_cmp_ui', `mpz_cmp_si', and `mpq_cmp_ui' are now
  830. -     implementated as macros, and thereby sometimes evaluate their
  831. -     arguments multiple times.
  832. -
  833. -  8. The functions `mpz_pow_ui' and `mpz_ui_pow_ui' now yield 1 for
  834. -     0^0.  (In version 1, they yielded 0.)
  835. -
  836. -
  837. -Getting the Latest Version of MP
  838. -================================
  839. -
  840. -   The latest version of the MP library is available by anonymous ftp
  841. -from from `prep.ai.mit.edu'.  The file name is
  842. -`/pub/gnu/gmp-M.N.tar.gz'.  Many sites around the world mirror `prep';
  843. -please use a mirror site near you.
  844. -
  845. -
  846. -File: gmp.info,  Node: Reporting Bugs,  Next: Integer Functions,  Prev: MP Basics,  Up: Top
  847. -
  848. -Reporting Bugs
  849. -**************
  850. -
  851. -   If you think you have found a bug in the MP library, please
  852. -investigate it and report it.  We have made this library available to
  853. -you, and it is not to ask too much from you, to ask you to report the
  854. -bugs that you find.
  855. -
  856. -   There are a few things you should think about when you put your bug
  857. -report together.
  858. -
  859. -   You have to send us a test case that makes it possible for us to
  860. -reproduce the bug.  Include instructions on how to run the test case.
  861. -
  862. -   You also have to explain what is wrong; if you get a crash, or if
  863. -the results printed are incorrect and in that case, in what way.
  864. -
  865. -   It is not uncommon that an observed problem is actually due to a bug
  866. -in the compiler used when building MP; the MP code tends to explore
  867. -interesting corners in compilers.  Therefore, please include compiler
  868. -version information in your bug report.  This can be extracted using
  869. -`what `which cc`', or, if you're using gcc, `gcc -v'.  Also, include
  870. -the output from `uname -a'.
  871. -
  872. -   If your bug report is good, we will do our best to help you to get a
  873. -corrected version of the library; if the bug report is poor, we won't
  874. -do anything about it (aside of chiding you to send better bug reports).
  875. -
  876. -   Send your bug report to: `bug-gmp@prep.ai.mit.edu'.
  877. -
  878. -   If you think something in this manual is unclear, or downright
  879. -incorrect, or if the language needs to be improved, please send a note
  880. -to the same address.
  881. -
  882. -
  883. -File: gmp.info,  Node: Integer Functions,  Next: Rational Number Functions,  Prev: Reporting Bugs,  Up: Top
  884. -
  885. -Integer Functions
  886. -*****************
  887. -
  888. -   This chapter describes the MP functions for performing integer
  889. -arithmetic.  These functions start with the prefix `mpz_'.
  890. -
  891. -   Arbitrary precision integers are stored in objects of type `mpz_t'.
  892. -
  893. -* Menu:
  894. -
  895. -* Initializing Integers::
  896. -* Assigning Integers::
  897. -* Simultaneous Integer Init & Assign::
  898. -* Converting Integers::
  899. -* Integer Arithmetic::
  900. -* Comparison Functions::
  901. -* Integer Logic and Bit Fiddling::
  902. -* I/O of Integers::
  903. -* Miscellaneous Integer Functions::
  904. -
  905. -
  906. -File: gmp.info,  Node: Initializing Integers,  Next: Assigning Integers,  Up: Integer Functions
  907. -
  908. -Initialization and Assignment Functions
  909. -=======================================
  910. -
  911. -   The functions for integer arithmetic assume that all integer objects
  912. -are initialized.  You do that by calling the function `mpz_init'.
  913. -
  914. - - Function: void mpz_init (mpz_t INTEGER)
  915. -     Initialize INTEGER with limb space and set the initial numeric
  916. -     value to 0.  Each variable should normally only be initialized
  917. -     once, or at least cleared out (using `mpz_clear') between each
  918. -     initialization.
  919. -
  920. -   Here is an example of using `mpz_init':
  921. -
  922. -     {
  923. -       mpz_t integ;
  924. -       mpz_init (integ);
  925. -       ...
  926. -       mpz_add (integ, ...);
  927. -       ...
  928. -       mpz_sub (integ, ...);
  929. -     
  930. -       /* Unless the program is about to exit, do ... */
  931. -       mpz_clear (integ);
  932. -     }
  933. -
  934. -As you can see, you can store new values any number of times, once an
  935. -object is initialized.
  936. -
  937. - - Function: void mpz_clear (mpz_t INTEGER)
  938. -     Free the limb space occupied by INTEGER.  Make sure to call this
  939. -     function for all `mpz_t' variables when you are done with them.
  940. -
  941. - - Function: void * _mpz_realloc (mpz_t INTEGER, mp_size_t NEW_ALLOC)
  942. -     Change the limb space allocation to NEW_ALLOC limbs.  This
  943. -     function is not normally called from user code, but it can be used
  944. -     to give memory back to the heap, or to increase the space of a
  945. -     variable to avoid repeated automatic re-allocation.
  946. -
  947. - - Function: void mpz_array_init (mpz_t INTEGER_ARRAY[], size_t
  948. -          ARRAY_SIZE, mp_size_t FIXED_NUM_BITS)
  949. -     Allocate *fixed* limb space for all ARRAY_SIZE integers in
  950. -     INTEGER_ARRAY.  The fixed allocation for each integer in the array
  951. -     is enough to store FIXED_NUM_BITS.  If the fixed space will be
  952. -     insufficient for storing the result of a subsequent calculation,
  953. -     the result is unpredictable.
  954. -
  955. -     This function is useful for decreasing the working set for some
  956. -     algorithms that use large integer arrays.
  957. -
  958. -     There is no way to de-allocate the storage allocated by this
  959. -     function.  Don't call `mpz_clear'!
  960. -
  961. -
  962. -File: gmp.info,  Node: Assigning Integers,  Next: Simultaneous Integer Init & Assign,  Prev: Initializing Integers,  Up: Integer Functions
  963. -
  964. -Assignment Functions
  965. ---------------------
  966. -
  967. -   These functions assign new values to already initialized integers
  968. -(*note Initializing Integers::.).
  969. -
  970. - - Function: void mpz_set (mpz_t ROP, mpz_t OP)
  971. - - Function: void mpz_set_ui (mpz_t ROP, unsigned long int OP)
  972. - - Function: void mpz_set_si (mpz_t ROP, signed long int OP)
  973. - - Function: void mpz_set_d (mpz_t ROP, double OP)
  974. - - Function: void mpz_set_q (mpz_t ROP, mpq_t OP)
  975. - - Function: void mpz_set_f (mpz_t ROP, mpf_t OP)
  976. -     Set the value of ROP from OP.
  977. -
  978. - - Function: int mpz_set_str (mpz_t ROP, char *STR, int BASE)
  979. -     Set the value of ROP from STR, a '\0'-terminated C string in base
  980. -     BASE.  White space is allowed in the string, and is simply
  981. -     ignored.  The base may vary from 2 to 36.  If BASE is 0, the
  982. -     actual base is determined from the leading characters: if the
  983. -     first two characters are `0x' or `0X', hexadecimal is assumed,
  984. -     otherwise if the first character is `0', octal is assumed,
  985. -     otherwise decimal is assumed.
  986. -
  987. -     This function returns 0 if the entire string up to the '\0' is a
  988. -     valid number in base BASE.  Otherwise it returns -1.
  989. -
  990. -
  991. -File: gmp.info,  Node: Simultaneous Integer Init & Assign,  Next: Converting Integers,  Prev: Assigning Integers,  Up: Integer Functions
  992. -
  993. -Combined Initialization and Assignment Functions
  994. -------------------------------------------------
  995. -
  996. -   For convenience, MP provides a parallel series of initialize-and-set
  997. -functions which initialize the output and then store the value there.
  998. -These functions' names have the form `mpz_init_set...'
  999. -
  1000. -   Here is an example of using one:
  1001. -
  1002. -     {
  1003. -       mpz_t pie;
  1004. -       mpz_init_set_str (pie, "3141592653589793238462643383279502884", 10);
  1005. -       ...
  1006. -       mpz_sub (pie, ...);
  1007. -       ...
  1008. -       mpz_clear (pie);
  1009. -     }
  1010. -
  1011. -Once the integer has been initialized by any of the `mpz_init_set...'
  1012. -functions, it can be used as the source or destination operand for the
  1013. -ordinary integer functions.  Don't use an initialize-and-set function
  1014. -on a variable already initialized!
  1015. -
  1016. - - Function: void mpz_init_set (mpz_t ROP, mpz_t OP)
  1017. - - Function: void mpz_init_set_ui (mpz_t ROP, unsigned long int OP)
  1018. - - Function: void mpz_init_set_si (mpz_t ROP, signed long int OP)
  1019. - - Function: void mpz_init_set_d (mpz_t ROP, double OP)
  1020. -     Initialize ROP with limb space and set the initial numeric value
  1021. -     from OP.
  1022. -
  1023. - - Function: int mpz_init_set_str (mpz_t ROP, char *STR, int BASE)
  1024. -     Initialize ROP and set its value like `mpz_set_str' (see its
  1025. -     documentation above for details).
  1026. -
  1027. -     If the string is a correct base BASE number, the function returns
  1028. -     0; if an error occurs it returns -1.  ROP is initialized even if
  1029. -     an error occurs.  (I.e., you have to call `mpz_clear' for it.)
  1030. -
  1031. -
  1032. -File: gmp.info,  Node: Converting Integers,  Next: Integer Arithmetic,  Prev: Simultaneous Integer Init & Assign,  Up: Integer Functions
  1033. -
  1034. -Conversion Functions
  1035. -====================
  1036. -
  1037. -   This section describes functions for converting arbitrary precision
  1038. -integers to standard C types.  Functions for converting *to* arbitrary
  1039. -precision integers are described in *Note Assigning Integers:: and
  1040. -*Note I/O of Integers::.
  1041. -
  1042. - - Function: unsigned long int mpz_get_ui (mpz_t OP)
  1043. -     Return the least significant part from OP.  This function combined
  1044. -     with
  1045. -     `mpz_tdiv_q_2exp(..., OP, CHAR_BIT*sizeof(unsigned long int))' can
  1046. -     be used to extract the limbs of an integer.
  1047. -
  1048. - - Function: signed long int mpz_get_si (mpz_t OP)
  1049. -     If OP fits into a `signed long int' return the value of OP.
  1050. -     Otherwise return the least significant part of OP, with the same
  1051. -     sign as OP.
  1052. -
  1053. -     If OP is too large to fit in a `signed long int', the returned
  1054. -     result is probably not very useful.
  1055. -
  1056. - - Function: double mpz_get_d (mpz_t OP)
  1057. -     Convert OP to a double.
  1058. -
  1059. - - Function: char * mpz_get_str (char *STR, int BASE, mpz_t OP)
  1060. -     Convert OP to a string of digits in base BASE.  The base may vary
  1061. -     from 2 to 36.
  1062. -
  1063. -     If STR is NULL, space for the result string is allocated using the
  1064. -     default allocation function, and a pointer to the string is
  1065. -     returned.
  1066. -
  1067. -     If STR is not NULL, it should point to a block of storage enough
  1068. -     large for the result.  To find out the right amount of space to
  1069. -     provide for STR, use `mpz_sizeinbase (OP, BASE) + 2'.  The two
  1070. -     extra bytes are for a possible minus sign, and for the terminating
  1071. -     null character.
  1072. -
  1073. -
  1074. -File: gmp.info,  Node: Integer Arithmetic,  Next: Comparison Functions,  Prev: Converting Integers,  Up: Integer Functions
  1075. -
  1076. -Arithmetic Functions
  1077. -====================
  1078. -
  1079. - - Function: void mpz_add (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1080. - - Function: void mpz_add_ui (mpz_t ROP, mpz_t OP1, unsigned long int
  1081. -          OP2)
  1082. -     Set ROP to OP1 + OP2.
  1083. -
  1084. - - Function: void mpz_sub (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1085. - - Function: void mpz_sub_ui (mpz_t ROP, mpz_t OP1, unsigned long int
  1086. -          OP2)
  1087. -     Set ROP to OP1 - OP2.
  1088. -
  1089. - - Function: void mpz_mul (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1090. - - Function: void mpz_mul_ui (mpz_t ROP, mpz_t OP1, unsigned long int
  1091. -          OP2)
  1092. -     Set ROP to OP1 times OP2.
  1093. -
  1094. - - Function: void mpz_mul_2exp (mpz_t ROP, mpz_t OP1, unsigned long int
  1095. -          OP2)
  1096. -     Set ROP to OP1 times 2 raised to OP2.  This operation can also be
  1097. -     defined as a left shift, OP2 steps.
  1098. -
  1099. - - Function: void mpz_neg (mpz_t ROP, mpz_t OP)
  1100. -     Set ROP to -OP.
  1101. -
  1102. - - Function: void mpz_abs (mpz_t ROP, mpz_t OP)
  1103. -     Set ROP to the absolute value of OP.
  1104. -
  1105. - - Function: void mpz_fac_ui (mpz_t ROP, unsigned long int OP)
  1106. -     Set ROP to OP!, the factorial of OP.
  1107. -
  1108. -Division functions
  1109. -------------------
  1110. -
  1111. -   Division is undefined if the divisor is zero, and passing a zero
  1112. -divisor to the divide or modulo functions, as well passing a zero mod
  1113. -argument to the `mpz_powm' and `mpz_powm_ui' functions, will make these
  1114. -functions intentionally divide by zero.  This gives the user the
  1115. -possibility to handle arithmetic exceptions in these functions in the
  1116. -same manner as other arithmetic exceptions.
  1117. -
  1118. -   There are three main groups of division functions:
  1119. -   * Functions that truncate the quotient towards 0.  The names of these
  1120. -     functions start with `mpz_tdiv'.  The `t' in the name is short for
  1121. -     `truncate'.
  1122. -
  1123. -   * Functions that round the quotient towards -infinity.  The names of
  1124. -     these routines start with `mpz_fdiv'.  The `f' in the name is
  1125. -     short for `floor'.
  1126. -
  1127. -   * Functions that round the quotient towards +infinity.  The names of
  1128. -     these routines start with `mpz_cdiv'.  The `c' in the name is
  1129. -     short for `ceil'.
  1130. -
  1131. -   For each rounding mode, there are a couple of variants.  Here `q'
  1132. -means that the quotient is computed, while `r' means that the remainder
  1133. -is computed.  Functions that compute both the quotient and remainder
  1134. -have `qr' in the name.
  1135. -
  1136. - - Function: void mpz_tdiv_q (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1137. - - Function: void mpz_tdiv_q_ui (mpz_t ROP, mpz_t OP1, unsigned long
  1138. -          int OP2)
  1139. -     Set ROP to [OP1/OP2].  The quotient is truncated towards 0.
  1140. -
  1141. - - Function: void mpz_tdiv_r (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1142. - - Function: void mpz_tdiv_r_ui (mpz_t ROP, mpz_t OP1, unsigned long
  1143. -          int OP2)
  1144. -     Set ROP to (OP1 - [OP1/OP2] * OP2).  Unless the remainder is zero,
  1145. -     it has the same sign as the dividend.
  1146. -
  1147. - - Function: void mpz_tdiv_qr (mpz_t ROP1, mpz_t ROP2, mpz_t OP1, mpz_t
  1148. -          OP2)
  1149. - - Function: void mpz_tdiv_qr_ui (mpz_t ROP1, mpz_t ROP2, mpz_t OP1,
  1150. -          unsigned long int OP2)
  1151. -     Divide OP1 by OP2 and put the quotient in ROP1 and the remainder
  1152. -     in ROP2.  The quotient is rounded towards 0.  Unless the remainder
  1153. -     is zero, it has the same sign as the dividend.
  1154. -
  1155. -     If ROP1 and ROP2 are the same variable, the results are undefined.
  1156. -
  1157. - - Function: void mpz_fdiv_q (mpz_t ROP1, mpz_t OP1, mpz_t OP2)
  1158. - - Function: void mpz_fdiv_q_ui (mpz_t ROP, mpz_t OP1, unsigned long
  1159. -          int OP2)
  1160. -     Set ROP to OP1/OP2.  The quotient is rounded towards -infinity.
  1161. -
  1162. - - Function: void mpz_fdiv_r (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1163. - - Function: unsigned long int mpz_fdiv_r_ui (mpz_t ROP, mpz_t OP1,
  1164. -          unsigned long int OP2)
  1165. -     Divide OP1 by OP2 and put the remainder in ROP.  Unless the
  1166. -     remainder is zero, it has the same sign as the divisor.
  1167. -
  1168. -     For `mpz_fdiv_r_ui' the remainder is small enough to fit in an
  1169. -     `unsigned long int', and is therefore returned.
  1170. -
  1171. - - Function: void mpz_fdiv_qr (mpz_t ROP1, mpz_t ROP2, mpz_t OP1, mpz_t
  1172. -          OP2)
  1173. - - Function: unsigned long int mpz_fdiv_qr_ui (mpz_t ROP1, mpz_t ROP2,
  1174. -          mpz_t OP1, unsigned long int OP2)
  1175. -     Divide OP1 by OP2 and put the quotient in ROP1 and the remainder
  1176. -     in ROP2.  The quotient is rounded towards -infinity.  Unless the
  1177. -     remainder is zero, it has the same sign as the divisor.
  1178. -
  1179. -     For `mpz_fdiv_qr_ui' the remainder is small enough to fit in an
  1180. -     `unsigned long int', and is therefore returned.
  1181. -
  1182. -     If ROP1 and ROP2 are the same variable, the results are undefined.
  1183. -
  1184. - - Function: unsigned long int mpz_fdiv_ui (mpz_t OP1, unsigned long
  1185. -          int OP2)
  1186. -     This function is similar to `mpz_fdiv_r_ui', but the remainder is
  1187. -     only returned; it is not stored anywhere.
  1188. -
  1189. - - Function: void mpz_cdiv_q (mpz_t ROP1, mpz_t OP1, mpz_t OP2)
  1190. - - Function: void mpz_cdiv_q_ui (mpz_t ROP, mpz_t OP1, unsigned long
  1191. -          int OP2)
  1192. -     Set ROP to OP1/OP2.  The quotient is rounded towards +infinity.
  1193. -
  1194. - - Function: void mpz_cdiv_r (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1195. - - Function: unsigned long int mpz_cdiv_r_ui (mpz_t ROP, mpz_t OP1,
  1196. -          unsigned long int OP2)
  1197. -     Divide OP1 by OP2 and put the remainder in ROP.  Unless the
  1198. -     remainder is zero, it has the opposite sign as the divisor.
  1199. -
  1200. -     For `mpz_cdiv_r_ui' the negated remainder is small enough to fit
  1201. -     in an `unsigned long int', and it is therefore returned.
  1202. -
  1203. - - Function: void mpz_cdiv_qr (mpz_t ROP1, mpz_t ROP2, mpz_t OP1, mpz_t
  1204. -          OP2)
  1205. - - Function: unsigned long int mpz_cdiv_qr_ui (mpz_t ROP1, mpz_t ROP2,
  1206. -          mpz_t OP1, unsigned long int OP2)
  1207. -     Divide OP1 by OP2 and put the quotient in ROP1 and the remainder
  1208. -     in ROP2.  The quotient is rounded towards +infinity.  Unless the
  1209. -     remainder is zero, it has the opposite sign as the divisor.
  1210. -
  1211. -     For `mpz_cdiv_qr_ui' the negated remainder is small enough to fit
  1212. -     in an `unsigned long int', and it is therefore returned.
  1213. -
  1214. -     If ROP1 and ROP2 are the same variable, the results are undefined.
  1215. -
  1216. - - Function: unsigned long int mpz_cdiv_ui (mpz_t OP1, unsigned long
  1217. -          int OP2)
  1218. -     Return the negated remainder, similar to `mpz_cdiv_r_ui'.  (The
  1219. -     difference is that this function doesn't store the remainder
  1220. -     anywhere.)
  1221. -
  1222. - - Function: void mpz_mod (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1223. - - Function: unsigned long int mpz_mod_ui (mpz_t ROP, mpz_t OP1,
  1224. -          unsigned long int OP2)
  1225. -     Set ROP to OP1 `mod' OP2.  The sign of the divisor is ignored, and
  1226. -     the result is always non-negative.
  1227. -
  1228. -     For `mpz_mod_ui' the remainder is small enough to fit in an
  1229. -     `unsigned long int', and is therefore returned.
  1230. -
  1231. - - Function: void mpz_divexact (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1232. -     Set ROP to OP1/OP2.  This function produces correct results only
  1233. -     when it is known in advance that OP2 divides OP1.
  1234. -
  1235. -     Since mpz_divexact is much faster than any of the other routines
  1236. -     that produce the quotient (*note References::. Jebelean), it is
  1237. -     the best choice for instances in which exact division is known to
  1238. -     occur, such as reducing a rational to lowest terms.
  1239. -
  1240. - - Function: void mpz_tdiv_q_2exp (mpz_t ROP, mpz_t OP1, unsigned long
  1241. -          int OP2)
  1242. -     Set ROP to OP1 divided by 2 raised to OP2.  The quotient is
  1243. -     rounded towards 0.
  1244. -
  1245. - - Function: void mpz_tdiv_r_2exp (mpz_t ROP, mpz_t OP1, unsigned long
  1246. -          int OP2)
  1247. -     Divide OP1 by (2 raised to OP2) and put the remainder in ROP.
  1248. -     Unless it is zero, ROP will have the same sign as OP1.
  1249. -
  1250. - - Function: void mpz_fdiv_q_2exp (mpz_t ROP, mpz_t OP1, unsigned long
  1251. -          int OP2)
  1252. -     Set ROP to OP1 divided by 2 raised to OP2.  The quotient is
  1253. -     rounded towards -infinity.
  1254. -
  1255. - - Function: void mpz_fdiv_r_2exp (mpz_t ROP, mpz_t OP1, unsigned long
  1256. -          int OP2)
  1257. -     Divide OP1 by (2 raised to OP2) and put the remainder in ROP.  The
  1258. -     sign of ROP will always be positive.
  1259. -
  1260. -     This operation can also be defined as masking of the OP2 least
  1261. -     significant bits.
  1262. -
  1263. -Exponentialization Functions
  1264. -----------------------------
  1265. -
  1266. - - Function: void mpz_powm (mpz_t ROP, mpz_t BASE, mpz_t EXP, mpz_t MOD)
  1267. - - Function: void mpz_powm_ui (mpz_t ROP, mpz_t BASE, unsigned long int
  1268. -          EXP, mpz_t MOD)
  1269. -     Set ROP to (BASE raised to EXP) `mod' MOD.  If EXP is negative,
  1270. -     the result is undefined.
  1271. -
  1272. - - Function: void mpz_pow_ui (mpz_t ROP, mpz_t BASE, unsigned long int
  1273. -          EXP)
  1274. - - Function: void mpz_ui_pow_ui (mpz_t ROP, unsigned long int BASE,
  1275. -          unsigned long int EXP)
  1276. -     Set ROP to BASE raised to EXP.  The case of 0^0 yields 1.
  1277. -
  1278. -Square Root Functions
  1279. ----------------------
  1280. -
  1281. - - Function: void mpz_sqrt (mpz_t ROP, mpz_t OP)
  1282. -     Set ROP to the truncated integer part of the square root of OP.
  1283. -
  1284. - - Function: void mpz_sqrtrem (mpz_t ROP1, mpz_t ROP2, mpz_t OP)
  1285. -     Set ROP1 to the truncated integer part of the square root of OP,
  1286. -     like `mpz_sqrt'.  Set ROP2 to OP-ROP1*ROP1, (i.e., zero if OP is a
  1287. -     perfect square).
  1288. -
  1289. -     If ROP1 and ROP2 are the same variable, the results are undefined.
  1290. -
  1291. - - Function: int mpz_perfect_square_p (mpz_t OP)
  1292. -     Return non-zero if OP is a perfect square, i.e., if the square
  1293. -     root of OP is an integer.  Return zero otherwise.
  1294. -
  1295. -Number Theoretic Functions
  1296. ---------------------------
  1297. -
  1298. - - Function: int mpz_probab_prime_p (mpz_t OP, int REPS)
  1299. -     If this function returns 0, OP is definitely not prime.  If it
  1300. -     returns 1, then OP is `probably' prime.  The probability of a
  1301. -     false positive is (1/4)**REPS.  A reasonable value of reps is 25.
  1302. -
  1303. -     An implementation of the probabilistic primality test found in
  1304. -     Seminumerical Algorithms (*note References::. Knuth).
  1305. -
  1306. - - Function: void mpz_gcd (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1307. -     Set ROP to the greatest common divisor of OP1 and OP2.
  1308. -
  1309. - - Function: unsigned long int mpz_gcd_ui (mpz_t ROP, mpz_t OP1,
  1310. -          unsigned long int OP2)
  1311. -     Compute the greatest common divisor of OP1 and OP2.  If ROP is not
  1312. -     NULL, store the result there.
  1313. -
  1314. -     If the result is small enough to fit in an `unsigned long int', it
  1315. -     is returned.  If the result does not fit, 0 is returned, and the
  1316. -     result is equal to the argument OP1.  Note that the result will
  1317. -     always fit if OP2 is non-zero.
  1318. -
  1319. - - Function: void mpz_gcdext (mpz_t G, mpz_t S, mpz_t T, mpz_t A, mpz_t
  1320. -          B)
  1321. -     Compute G, S, and T, such that AS + BT = G = `gcd' (A, B).  If T is
  1322. -     NULL, that argument is not computed.
  1323. -
  1324. - - Function: int mpz_invert (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1325. -     Compute the inverse of OP1 modulo OP2 and put the result in ROP.
  1326. -     Return non-zero if an inverse exist, zero otherwise.  When the
  1327. -     function returns zero, do not assume anything about the value in
  1328. -     ROP.
  1329. -
  1330. - - Function: int mpz_jacobi (mpz_t OP1, mpz_t OP2)
  1331. - - Function: int mpz_legendre (mpz_t OP1, mpz_t OP2)
  1332. -     Compute the Jacobi and Legendre symbols, respectively.
  1333. -
  1334. -
  1335. -File: gmp.info,  Node: Comparison Functions,  Next: Integer Logic and Bit Fiddling,  Prev: Integer Arithmetic,  Up: Integer Functions
  1336. -
  1337. -Comparison Functions
  1338. -====================
  1339. -
  1340. - - Function: int mpz_cmp (mpz_t OP1, mpz_t OP2)
  1341. -     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
  1342. -     if OP1 = OP2, and a negative value if OP1 < OP2.
  1343. -
  1344. - - Macro: int mpz_cmp_ui (mpz_t OP1, unsigned long int OP2)
  1345. - - Macro: int mpz_cmp_si (mpz_t OP1, signed long int OP2)
  1346. -     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
  1347. -     if OP1 = OP2, and a negative value if OP1 < OP2.
  1348. -
  1349. -     These functions are actually implemented as macros.  They evaluate
  1350. -     their arguments multiple times.
  1351. -
  1352. - - Macro: int mpz_sgn (mpz_t OP)
  1353. -     Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.
  1354. -
  1355. -     This function is actually implemented as a macro.  It evaluates its
  1356. -     arguments multiple times.
  1357. -
  1358. -
  1359. -File: gmp.info,  Node: Integer Logic and Bit Fiddling,  Next: I/O of Integers,  Prev: Comparison Functions,  Up: Integer Functions
  1360. -
  1361. -Logical and Bit Manipulation Functions
  1362. -======================================
  1363. -
  1364. -   These functions behave as if two's complement arithmetic were used
  1365. -(although sign-magnitude is used by the actual implementation).
  1366. -
  1367. - - Function: void mpz_and (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1368. -     Set ROP to OP1 logical-and OP2.
  1369. -
  1370. - - Function: void mpz_ior (mpz_t ROP, mpz_t OP1, mpz_t OP2)
  1371. -     Set ROP to OP1 inclusive-or OP2.
  1372. -
  1373. - - Function: void mpz_com (mpz_t ROP, mpz_t OP)
  1374. -     Set ROP to the one's complement of OP.
  1375. -
  1376. - - Function: unsigned long int mpz_popcount (mpz_t OP)
  1377. -     For non-negative numbers, return the population count of OP.  For
  1378. -     negative numbers, return the largest possible value (MAX_ULONG).
  1379. -
  1380. - - Function: unsigned long int mpz_hamdist (mpz_t OP1, mpz_t OP2)
  1381. -     If OP1 and OP2 are both non-negative, return the hamming distance
  1382. -     between the two operands.  Otherwise, return the largest possible
  1383. -     value (MAX_ULONG).
  1384. -
  1385. -     It is possible to extend this function to return a useful value
  1386. -     when the operands are both negative, but the current
  1387. -     implementation returns MAX_ULONG in this case.  *Do not depend on
  1388. -     this behavior, since it will change in future versions of the
  1389. -     library.*
  1390. -
  1391. - - Function: unsigned long int mpz_scan0 (mpz_t OP, unsigned long int
  1392. -          STARTING_BIT)
  1393. -     Scan OP, starting with bit STARTING_BIT, towards more significant
  1394. -     bits, until the first clear bit is found.  Return the index of the
  1395. -     found bit.
  1396. -
  1397. - - Function: unsigned long int mpz_scan1 (mpz_t OP, unsigned long int
  1398. -          STARTING_BIT)
  1399. -     Scan OP, starting with bit STARTING_BIT, towards more significant
  1400. -     bits, until the first set bit is found.  Return the index of the
  1401. -     found bit.
  1402. -
  1403. - - Function: void mpz_setbit (mpz_t ROP, unsigned long int BIT_INDEX)
  1404. -     Set bit BIT_INDEX in OP1.
  1405. -
  1406. - - Function: void mpz_clrbit (mpz_t ROP, unsigned long int BIT_INDEX)
  1407. -     Clear bit BIT_INDEX in OP1.
  1408. -
  1409. -
  1410. -File: gmp.info,  Node: I/O of Integers,  Next: Miscellaneous Integer Functions,  Prev: Integer Logic and Bit Fiddling,  Up: Integer Functions
  1411. -
  1412. -Input and Output Functions
  1413. -==========================
  1414. -
  1415. -   Functions that perform input from a stdio stream, and functions that
  1416. -output to a stdio stream.  Passing a NULL pointer for a STREAM argument
  1417. -to any of these functions will make them read from `stdin' and write to
  1418. -`stdout', respectively.
  1419. -
  1420. -   When using any of these functions, it is a good idea to include
  1421. -`stdio.h' before `gmp.h', since that will allow `gmp.h' to define
  1422. -prototypes for these functions.
  1423. -
  1424. - - Function: size_t mpz_out_str (FILE *STREAM, int BASE, mpz_t OP)
  1425. -     Output OP on stdio stream STREAM, as a string of digits in base
  1426. -     BASE.  The base may vary from 2 to 36.
  1427. -
  1428. -     Return the number of bytes written, or if an error occurred,
  1429. -     return 0.
  1430. -
  1431. - - Function: size_t mpz_inp_str (mpz_t ROP, FILE *STREAM, int BASE)
  1432. -     Input a possibly white-space preceded string in base BASE from
  1433. -     stdio stream STREAM, and put the read integer in ROP.  The base
  1434. -     may vary from 2 to 36.  If BASE is 0, the actual base is
  1435. -     determined from the leading characters: if the first two
  1436. -     characters are `0x' or `0X', hexadecimal is assumed, otherwise if
  1437. -     the first character is `0', octal is assumed, otherwise decimal is
  1438. -     assumed.
  1439. -
  1440. -     Return the number of bytes read, or if an error occurred, return 0.
  1441. -
  1442. - - Function: size_t mpz_out_raw (FILE *STREAM, mpz_t OP)
  1443. -     Output OP on stdio stream STREAM, in raw binary format.  The
  1444. -     integer is written in a portable format, with 4 bytes of size
  1445. -     information, and that many bytes of limbs.  Both the size and the
  1446. -     limbs are written in decreasing significance order (i.e., in
  1447. -     big-endian).
  1448. -
  1449. -     The output can be read with `mpz_inp_raw'.
  1450. -
  1451. -     Return the number of bytes written, or if an error occurred,
  1452. -     return 0.
  1453. -
  1454. -     The output of this can not be read by `mpz_inp_raw' from GMP 1,
  1455. -     because of changes necessary for compatibility between 32-bit and
  1456. -     64-bit machines.
  1457. -
  1458. - - Function: size_t mpz_inp_raw (mpz_t ROP, FILE *STREAM)
  1459. -     Input from stdio stream STREAM in the format written by
  1460. -     `mpz_out_raw', and put the result in ROP.  Return the number of
  1461. -     bytes read, or if an error occurred, return 0.
  1462. -
  1463. -     This routine can read the output from `mpz_out_raw' also from GMP
  1464. -     1, in spite of changes necessary for compatibility between 32-bit
  1465. -     and 64-bit machines.
  1466. -
  1467. -
  1468. -File: gmp.info,  Node: Miscellaneous Integer Functions,  Prev: I/O of Integers,  Up: Integer Functions
  1469. -
  1470. -Miscellaneous Functions
  1471. -=======================
  1472. -
  1473. - - Function: void mpz_random (mpz_t ROP, mp_size_t MAX_SIZE)
  1474. -     Generate a random integer of at most MAX_SIZE limbs.  The generated
  1475. -     random number doesn't satisfy any particular requirements of
  1476. -     randomness.  Negative random numbers are generated when MAX_SIZE
  1477. -     is negative.
  1478. -
  1479. - - Function: void mpz_random2 (mpz_t ROP, mp_size_t MAX_SIZE)
  1480. -     Generate a random integer of at most MAX_SIZE limbs, with long
  1481. -     strings of zeros and ones in the binary representation.  Useful
  1482. -     for testing functions and algorithms, since this kind of random
  1483. -     numbers have proven to be more likely to trigger corner-case bugs.
  1484. -     Negative random numbers are generated when MAX_SIZE is negative.
  1485. -
  1486. - - Function: size_t mpz_size (mpz_t OP)
  1487. -     Return the size of OP measured in number of limbs.  If OP is zero,
  1488. -     the returned value will be zero.
  1489. -
  1490. -     *This function is obsolete.  It will disappear from future MP
  1491. -     releases.*
  1492. -
  1493. - - Function: size_t mpz_sizeinbase (mpz_t OP, int BASE)
  1494. -     Return the size of OP measured in number of digits in base BASE.
  1495. -     The base may vary from 2 to 36.  The returned value will be exact
  1496. -     or 1 too big.  If BASE is a power of 2, the returned value will
  1497. -     always be exact.
  1498. -
  1499. -     This function is useful in order to allocate the right amount of
  1500. -     space before converting OP to a string.  The right amount of
  1501. -     allocation is normally two more than the value returned by
  1502. -     `mpz_sizeinbase' (one extra for a minus sign and one for the
  1503. -     terminating '\0').
  1504. -
  1505. -
  1506. -File: gmp.info,  Node: Rational Number Functions,  Next: Floating-point Functions,  Prev: Integer Functions,  Up: Top
  1507. -
  1508. -Rational Number Functions
  1509. -*************************
  1510. -
  1511. -   This chapter describes the MP functions for performing arithmetic on
  1512. -rational numbers.  These functions start with the prefix `mpq_'.
  1513. -
  1514. -   Rational numbers are stored in objects of type `mpq_t'.
  1515. -
  1516. -   All rational arithmetic functions assume operands have a canonical
  1517. -form, and canonicalize their result.  The canonical from means that the
  1518. -denominator and the numerator have no common factors, and that the
  1519. -denominator is positive.  Zero has the unique representation 0/1.
  1520. -
  1521. -   Pure assignment functions do not canonicalize the assigned variable.
  1522. -It is the responsibility of the user to canonicalize the assigned
  1523. -variable before any arithmetic operations are performed on that
  1524. -variable.  *Note that this is an incompatible change from version 1 of
  1525. -the library.*
  1526. -
  1527. - - Function: void mpq_canonicalize (mpq_t OP)
  1528. -     Remove any factors that are common to the numerator and
  1529. -     denominator of OP, and make the denominator positive.
  1530. -
  1531. -* Menu:
  1532. -
  1533. -* Initializing Rationals::
  1534. -* Assigning Rationals::
  1535. -* Simultaneous Integer Init & Assign::
  1536. -* Comparing Rationals::
  1537. -* Applying Integer Functions::
  1538. -* Miscellaneous Rational Functions::
  1539. -
  1540. -
  1541. -File: gmp.info,  Node: Initializing Rationals,  Next: Assigning Rationals,  Prev: Rational Number Functions,  Up: Rational Number Functions
  1542. -
  1543. -Initialization and Assignment Functions
  1544. -=======================================
  1545. -
  1546. - - Function: void mpq_init (mpq_t DEST_RATIONAL)
  1547. -     Initialize DEST_RATIONAL and set it to 0/1.  Each variable should
  1548. -     normally only be initialized once, or at least cleared out (using
  1549. -     the function `mpq_clear') between each initialization.
  1550. -
  1551. - - Function: void mpq_clear (mpq_t RATIONAL_NUMBER)
  1552. -     Free the space occupied by RATIONAL_NUMBER.  Make sure to call this
  1553. -     function for all `mpq_t' variables when you are done with them.
  1554. -
  1555. - - Function: void mpq_set (mpq_t ROP, mpq_t OP)
  1556. - - Function: void mpq_set_z (mpq_t ROP, mpz_t OP)
  1557. -     Assign ROP from OP.
  1558. -
  1559. - - Function: void mpq_set_ui (mpq_t ROP, unsigned long int OP1,
  1560. -          unsigned long int OP2)
  1561. - - Function: void mpq_set_si (mpq_t ROP, signed long int OP1, unsigned
  1562. -          long int OP2)
  1563. -     Set the value of ROP to OP1/OP2.  Note that if OP1 and OP2 have
  1564. -     common factors, ROP has to be passed to `mpq_canonicalize' before
  1565. -     any operations are performed on ROP.
  1566. -
  1567. -
  1568. -File: gmp.info,  Node: Assigning Rationals,  Next: Comparing Rationals,  Prev: Initializing Rationals,  Up: Rational Number Functions
  1569. -
  1570. -Arithmetic Functions
  1571. -====================
  1572. -
  1573. - - Function: void mpq_add (mpq_t SUM, mpq_t ADDEND1, mpq_t ADDEND2)
  1574. -     Set SUM to ADDEND1 + ADDEND2.
  1575. -
  1576. - - Function: void mpq_sub (mpq_t DIFFERENCE, mpq_t MINUEND, mpq_t
  1577. -          SUBTRAHEND)
  1578. -     Set DIFFERENCE to MINUEND - SUBTRAHEND.
  1579. -
  1580. - - Function: void mpq_mul (mpq_t PRODUCT, mpq_t MULTIPLIER, mpq_t
  1581. -          MULTIPLICAND)
  1582. -     Set PRODUCT to MULTIPLIER times MULTIPLICAND.
  1583. -
  1584. - - Function: void mpq_div (mpq_t QUOTIENT, mpq_t DIVIDEND, mpq_t
  1585. -          DIVISOR)
  1586. -     Set QUOTIENT to DIVIDEND/DIVISOR.
  1587. -
  1588. - - Function: void mpq_neg (mpq_t NEGATED_OPERAND, mpq_t OPERAND)
  1589. -     Set NEGATED_OPERAND to -OPERAND.
  1590. -
  1591. - - Function: void mpq_inv (mpq_t INVERTED_NUMBER, mpq_t NUMBER)
  1592. -     Set INVERTED_NUMBER to 1/NUMBER.  If the new denominator is zero,
  1593. -     this routine will divide by zero.
  1594. -
  1595. -
  1596. -File: gmp.info,  Node: Comparing Rationals,  Next: Applying Integer Functions,  Prev: Assigning Rationals,  Up: Rational Number Functions
  1597. -
  1598. -Comparison Functions
  1599. -====================
  1600. -
  1601. - - Function: int mpq_cmp (mpq_t OP1, mpq_t OP2)
  1602. -     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
  1603. -     if OP1 = OP2, and a negative value if OP1 < OP2.
  1604. -
  1605. -     To determine if two rationals are equal, `mpq_equal' is faster than
  1606. -     `mpq_cmp'.
  1607. -
  1608. - - Macro: int mpq_cmp_ui (mpq_t OP1, unsigned long int NUM2, unsigned
  1609. -          long int DEN2)
  1610. -     Compare OP1 and NUM2/DEN2.  Return a positive value if OP1 >
  1611. -     NUM2/DEN2, zero if OP1 = NUM2/DEN2, and a negative value if OP1 <
  1612. -     NUM2/DEN2.
  1613. -
  1614. -     This routine allows that NUM2 and DEN2 have common factors.
  1615. -
  1616. -     This function is actually implemented as a macro.  It evaluates its
  1617. -     arguments multiple times.
  1618. -
  1619. - - Macro: int mpq_sgn (mpq_t OP)
  1620. -     Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.
  1621. -
  1622. -     This function is actually implemented as a macro.  It evaluates its
  1623. -     arguments multiple times.
  1624. -
  1625. - - Function: int mpq_equal (mpq_t OP1, mpq_t OP2)
  1626. -     Return non-zero if OP1 and OP2 are equal, zero if they are
  1627. -     non-equal.  Although `mpq_cmp' can be used for the same purpose,
  1628. -     this function is much faster.
  1629. -
  1630. -
  1631. -File: gmp.info,  Node: Applying Integer Functions,  Next: Miscellaneous Rational Functions,  Prev: Comparing Rationals,  Up: Rational Number Functions
  1632. -
  1633. -Applying Integer Functions to Rationals
  1634. -=======================================
  1635. -
  1636. -   The set of `mpq' functions is quite small.  In particular, there are
  1637. -no functions for either input or output.  But there are two macros that
  1638. -allow us to apply any `mpz' function on the numerator or denominator of
  1639. -a rational number.  If these macros are used to assign to the rational
  1640. -number, `mpq_canonicalize' normally need to be called afterwards.
  1641. -
  1642. - - Macro: mpz_t mpq_numref (mpq_t OP)
  1643. - - Macro: mpz_t mpq_denref (mpq_t OP)
  1644. -     Return a reference to the numerator and denominator of OP,
  1645. -     respectively.  The `mpz' functions can be used on the result of
  1646. -     these macros.
  1647. -
  1648. -
  1649. -File: gmp.info,  Node: Miscellaneous Rational Functions,  Prev: Applying Integer Functions,  Up: Rational Number Functions
  1650. -
  1651. -Miscellaneous Functions
  1652. -=======================
  1653. -
  1654. - - Function: double mpq_get_d (mpq_t OP)
  1655. -     Convert OP to a double.
  1656. -
  1657. -   These functions assign between either the numerator or denominator
  1658. -of a rational, and an integer.  Instead of using these functions, it is
  1659. -preferable to use the more general mechanisms `mpq_numref' and
  1660. -`mpq_denref', together with `mpz_set'.
  1661. -
  1662. - - Function: void mpq_set_num (mpq_t RATIONAL, mpz_t NUMERATOR)
  1663. -     Copy NUMERATOR to the numerator of RATIONAL.  When this risks to
  1664. -     make the numerator and denominator of RATIONAL have common
  1665. -     factors, you have to pass RATIONAL to `mpq_canonicalize' before
  1666. -     any operations are performed on RATIONAL.
  1667. -
  1668. -     This function is equivalent to `mpz_set (mpq_numref (RATIONAL),
  1669. -     NUMERATOR)'.
  1670. -
  1671. - - Function: void mpq_set_den (mpq_t RATIONAL, mpz_t DENOMINATOR)
  1672. -     Copy DENOMINATOR to the denominator of RATIONAL.  When this risks
  1673. -     to make the numerator and denominator of RATIONAL have common
  1674. -     factors, or if the denominator might be negative, you have to pass
  1675. -     RATIONAL to `mpq_canonicalize' before any operations are performed
  1676. -     on RATIONAL.
  1677. -
  1678. -     *In version 1 of the library, negative denominators were handled by
  1679. -     copying the sign to the numerator.  That is no longer done.*
  1680. -
  1681. -     This function is equivalent to `mpz_set (mpq_denref (RATIONAL),
  1682. -     DENOMINATORS)'.
  1683. -
  1684. - - Function: void mpq_get_num (mpz_t NUMERATOR, mpq_t RATIONAL)
  1685. -     Copy the numerator of RATIONAL to the integer NUMERATOR, to
  1686. -     prepare for integer operations on the numerator.
  1687. -
  1688. -     This function is equivalent to `mpz_set (NUMERATOR, mpq_numref
  1689. -     (RATIONAL))'.
  1690. -
  1691. - - Function: void mpq_get_den (mpz_t DENOMINATOR, mpq_t RATIONAL)
  1692. -     Copy the denominator of RATIONAL to the integer DENOMINATOR, to
  1693. -     prepare for integer operations on the denominator.
  1694. -
  1695. -     This function is equivalent to `mpz_set (DENOMINATOR, mpq_denref
  1696. -     (RATIONAL))'.
  1697. -
  1698. diff -rup --new-file baseline/fsf/gmp/gmp.info-2 amiga/fsf/gmp/gmp.info-2
  1699. --- baseline/fsf/gmp/gmp.info-2    Thu Jun  6 12:30:58 1996
  1700. +++ amiga/fsf/gmp/gmp.info-2    Wed Dec 31 17:00:00 1969
  1701. @@ -1,1035 +0,0 @@
  1702. -This is Info file gmp.info, produced by Makeinfo-1.64 from the input
  1703. -file gmp.texi.
  1704. -
  1705. -START-INFO-DIR-ENTRY
  1706. -* gmp: (gmp.info).               GNU Multiple Precision Arithmetic Library.
  1707. -END-INFO-DIR-ENTRY
  1708. -
  1709. -   This file documents GNU MP, a library for arbitrary-precision
  1710. -arithmetic.
  1711. -
  1712. -   Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation,
  1713. -Inc.
  1714. -
  1715. -   Permission is granted to make and distribute verbatim copies of this
  1716. -manual provided the copyright notice and this permission notice are
  1717. -preserved on all copies.
  1718. -
  1719. -   Permission is granted to copy and distribute modified versions of
  1720. -this manual under the conditions for verbatim copying, provided that
  1721. -the entire resulting derived work is distributed under the terms of a
  1722. -permission notice identical to this one.
  1723. -
  1724. -   Permission is granted to copy and distribute translations of this
  1725. -manual into another language, under the above conditions for modified
  1726. -versions, except that this permission notice may be stated in a
  1727. -translation approved by the Foundation.
  1728. -
  1729. -
  1730. -File: gmp.info,  Node: Floating-point Functions,  Next: Low-level Functions,  Prev: Rational Number Functions,  Up: Top
  1731. -
  1732. -Floating-point Functions
  1733. -************************
  1734. -
  1735. -   This is a description of the *preliminary* interface for
  1736. -floating-point arithmetic in GNU MP 2.
  1737. -
  1738. -   The floating-point functions expect arguments of type `mpf_t'.
  1739. -
  1740. -   The MP floating-point functions have an interface that is similar to
  1741. -the MP integer functions.  The function prefix for floating-point
  1742. -operations is `mpf_'.
  1743. -
  1744. -   There is one significant characteristic of floating-point numbers
  1745. -that has motivated a difference between this function class and other
  1746. -MP function classes: the inherent inexactness of floating point
  1747. -arithmetic.  The user has to specify the precision of each variable.  A
  1748. -computation that assigns a variable will take place with the precision
  1749. -of the assigned variable; the precision of variables used as input is
  1750. -ignored.
  1751. -
  1752. -   The precision of a calculation is defined as follows: Compute the
  1753. -requested operation exactly (with "infinite precision"), and truncate
  1754. -the result to the destination variable precision.  Even if the user has
  1755. -asked for a very high precision, MP will not calculate with superfluous
  1756. -digits.  For example, if two low-precision numbers of nearly equal
  1757. -magnitude are added, the precision of the result will be limited to
  1758. -what is required to represent the result accurately.
  1759. -
  1760. -   The MP floating-point functions are *not* intended as a smooth
  1761. -extension to the IEEE P754 arithmetic.  Specifically, the results
  1762. -obtained on one computer often differs from the results obtained on a
  1763. -computer with a different word size.
  1764. -
  1765. -* Menu:
  1766. -
  1767. -* Initializing Floats::
  1768. -* Assigning Floats::
  1769. -* Simultaneous Float Init & Assign::
  1770. -* Converting Floats::
  1771. -* Float Arithmetic::
  1772. -* Float Comparison::
  1773. -* I/O of Floats::
  1774. -* Miscellaneous Float Functions::
  1775. -
  1776. -
  1777. -File: gmp.info,  Node: Initializing Floats,  Next: Assigning Floats,  Up: Floating-point Functions
  1778. -
  1779. -Initialization and Assignment Functions
  1780. -=======================================
  1781. -
  1782. - - Function: void mpf_set_default_prec (unsigned long int PREC)
  1783. -     Set the default precision to be *at least* PREC bits.  All
  1784. -     subsequent calls to `mpf_init' will use this precision, but
  1785. -     previously initialized variables are unaffected.
  1786. -
  1787. -   An `mpf_t' object must be initialized before storing the first value
  1788. -in it.  The functions `mpf_init' and `mpf_init2' are used for that
  1789. -purpose.
  1790. -
  1791. - - Function: void mpf_init (mpf_t X)
  1792. -     Initialize X to 0.  Normally, a variable should be initialized
  1793. -     once only or at least be cleared, using `mpf_clear', between
  1794. -     initializations.  The precision of X is undefined unless a default
  1795. -     precision has already been established by a call to
  1796. -     `mpf_set_default_prec'.
  1797. -
  1798. - - Function: void mpf_init2 (mpf_t X, unsigned long int PREC)
  1799. -     Initialize X to 0 and set its precision to be *at least* PREC
  1800. -     bits.  Normally, a variable should be initialized once only or at
  1801. -     least be cleared, using `mpf_clear', between initializations.
  1802. -
  1803. - - Function: void mpf_clear (mpf_t X)
  1804. -     Free the space occupied by X.  Make sure to call this function for
  1805. -     all `mpf_t' variables when you are done with them.
  1806. -
  1807. -   Here is an example on how to initialize floating-point variables:
  1808. -     {
  1809. -       mpf_t x, y;
  1810. -       mpf_init (x);            /* use default precision */
  1811. -       mpf_init2 (y, 256);        /* precision *at least* 256 bits */
  1812. -       ...
  1813. -       /* Unless the program is about to exit, do ... */
  1814. -       mpf_clear (x);
  1815. -       mpf_clear (y);
  1816. -     }
  1817. -
  1818. -   The following three functions are useful for changing the precision
  1819. -during a calculation.  A typical use would be for adjusting the
  1820. -precision gradually in iterative algorithms like Newton-Raphson, making
  1821. -the computation precision closely match the actual accurate part of the
  1822. -numbers.
  1823. -
  1824. - - Function: void mpf_set_prec (mpf_t ROP, unsigned long int PREC)
  1825. -     Set the precision of ROP to be *at least* PREC bits.  Since
  1826. -     changing the precision involves calls to `realloc', this routine
  1827. -     should not be called in a tight loop.
  1828. -
  1829. - - Function: unsigned long int mpf_get_prec (mpf_t OP)
  1830. -     Return the precision actually used for assignments of OP.
  1831. -
  1832. - - Function: void mpf_set_prec_raw (mpf_t ROP, unsigned long int PREC)
  1833. -     Set the precision of ROP to be *at least* PREC bits.  This is a
  1834. -     low-level function that does not change the allocation.  The PREC
  1835. -     argument must not be larger that the precision previously returned
  1836. -     by `mpf_get_prec'.  It is crucial that the precision of ROP is
  1837. -     ultimately reset to exactly the value returned by `mpf_get_prec'.
  1838. -
  1839. -
  1840. -File: gmp.info,  Node: Assigning Floats,  Next: Simultaneous Float Init & Assign,  Prev: Initializing Floats,  Up: Floating-point Functions
  1841. -
  1842. -Assignment Functions
  1843. ---------------------
  1844. -
  1845. -   These functions assign new values to already initialized floats
  1846. -(*note Initializing Floats::.).
  1847. -
  1848. - - Function: void mpf_set (mpf_t ROP, mpf_t OP)
  1849. - - Function: void mpf_set_ui (mpf_t ROP, unsigned long int OP)
  1850. - - Function: void mpf_set_si (mpf_t ROP, signed long int OP)
  1851. - - Function: void mpf_set_d (mpf_t ROP, double OP)
  1852. - - Function: void mpf_set_z (mpf_t ROP, mpz_t OP)
  1853. - - Function: void mpf_set_q (mpf_t ROP, mpq_t OP)
  1854. -     Set the value of ROP from OP.
  1855. -
  1856. - - Function: int mpf_set_str (mpf_t ROP, char *STR, int BASE)
  1857. -     Set the value of ROP from the string in STR.  The string is of the
  1858. -     form `M@N' or, if the base is 10 or less, alternatively `MeN'.
  1859. -     `M' is the mantissa and `N' is the exponent.  The mantissa is
  1860. -     always in the specified base.  The exponent is either in the
  1861. -     specified base or, if BASE is negative, in decimal.
  1862. -
  1863. -     The argument BASE may be in the ranges 2 to 36, or -36 to -2.
  1864. -     Negative values are used to specify that the exponent is in
  1865. -     decimal.
  1866. -
  1867. -     Unlike the corresponding `mpz' function, the base will not be
  1868. -     determined from the leading characters of the string if BASE is 0.
  1869. -     This is so that numbers like `0.23' are not interpreted as octal.
  1870. -
  1871. -     White space is allowed in the string, and is simply ignored.
  1872. -
  1873. -     This function returns 0 if the entire string up to the '\0' is a
  1874. -     valid number in base BASE.  Otherwise it returns -1.
  1875. -
  1876. -
  1877. -File: gmp.info,  Node: Simultaneous Float Init & Assign,  Next: Converting Floats,  Prev: Assigning Floats,  Up: Floating-point Functions
  1878. -
  1879. -Combined Initialization and Assignment Functions
  1880. -------------------------------------------------
  1881. -
  1882. -   For convenience, MP provides a parallel series of initialize-and-set
  1883. -functions which initialize the output and then store the value there.
  1884. -These functions' names have the form `mpf_init_set...'
  1885. -
  1886. -   Once the float has been initialized by any of the `mpf_init_set...'
  1887. -functions, it can be used as the source or destination operand for the
  1888. -ordinary float functions.  Don't use an initialize-and-set function on
  1889. -a variable already initialized!
  1890. -
  1891. - - Function: void mpf_init_set (mpf_t ROP, mpf_t OP)
  1892. - - Function: void mpf_init_set_ui (mpf_t ROP, unsigned long int OP)
  1893. - - Function: void mpf_init_set_si (mpf_t ROP, signed long int OP)
  1894. - - Function: void mpf_init_set_d (mpf_t ROP, double OP)
  1895. -     Initialize ROP and set its value from OP.
  1896. -
  1897. -     The precision of ROP will be taken from the active default
  1898. -     precision, as set by `mpf_set_default_prec'.
  1899. -
  1900. - - Function: int mpf_init_set_str (mpf_t ROP, char *STR, int BASE)
  1901. -     Initialize ROP and set its value from the string in STR.  See
  1902. -     `mpf_set_str' above for details on the assignment operation.
  1903. -
  1904. -     Note that ROP is initialized even if an error occurs.  (I.e., you
  1905. -     have to call `mpf_clear' for it.)
  1906. -
  1907. -     The precision of ROP will be taken from the active default
  1908. -     precision, as set by `mpf_set_default_prec'.
  1909. -
  1910. -
  1911. -File: gmp.info,  Node: Converting Floats,  Next: Float Arithmetic,  Prev: Simultaneous Float Init & Assign,  Up: Floating-point Functions
  1912. -
  1913. -Conversion Functions
  1914. -====================
  1915. -
  1916. - - Function: double mpf_get_d (mpf_t OP)
  1917. -     Convert OP to a double.
  1918. -
  1919. - - Function: char * mpf_get_str (char *STR, mp_exp_t *EXPPTR, int BASE,
  1920. -          size_t N_DIGITS, mpf_t OP)
  1921. -     Convert OP to a string of digits in base BASE.  The base may vary
  1922. -     from 2 to 36.  Generate at most N_DIGITS significant digits, or if
  1923. -     N_DIGITS is 0, the maximum number of digits accurately
  1924. -     representable by OP.
  1925. -
  1926. -     If STR is NULL, space for the mantissa is allocated using the
  1927. -     default allocation function, and a pointer to the string is
  1928. -     returned.
  1929. -
  1930. -     If STR is not NULL, it should point to a block of storage enough
  1931. -     large for the mantissa, i.e., N_DIGITS + 2.  The two extra bytes
  1932. -     are for a possible minus sign, and for the terminating null
  1933. -     character.
  1934. -
  1935. -     The exponent is written through the pointer EXPPTR.
  1936. -
  1937. -     If N_DIGITS is 0, the maximum number of digits meaningfully
  1938. -     achievable from the precision of OP will be generated.  Note that
  1939. -     the space requirements for STR in this case will be impossible for
  1940. -     the user to predetermine.  Therefore, you need to pass NULL for
  1941. -     the string argument whenever N_DIGITS is 0.
  1942. -
  1943. -     The generated string is a fraction, with an implicit radix point
  1944. -     immediately to the left of the first digit.  For example, the
  1945. -     number 3.1416 would be returned as "31416" in the string and 1
  1946. -     written at EXPPTR.
  1947. -
  1948. -
  1949. -File: gmp.info,  Node: Float Arithmetic,  Next: Float Comparison,  Prev: Converting Floats,  Up: Floating-point Functions
  1950. -
  1951. -Arithmetic Functions
  1952. -====================
  1953. -
  1954. - - Function: void mpf_add (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  1955. - - Function: void mpf_add_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  1956. -          OP2)
  1957. -     Set ROP to OP1 + OP2.
  1958. -
  1959. - - Function: void mpf_sub (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  1960. - - Function: void mpf_ui_sub (mpf_t ROP, unsigned long int OP1, mpf_t
  1961. -          OP2)
  1962. - - Function: void mpf_sub_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  1963. -          OP2)
  1964. -     Set ROP to OP1 - OP2.
  1965. -
  1966. - - Function: void mpf_mul (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  1967. - - Function: void mpf_mul_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  1968. -          OP2)
  1969. -     Set ROP to OP1 times OP2.
  1970. -
  1971. -   Division is undefined if the divisor is zero, and passing a zero
  1972. -divisor to the divide functions will make these functions intentionally
  1973. -divide by zero.  This gives the user the possibility to handle
  1974. -arithmetic exceptions in these functions in the same manner as other
  1975. -arithmetic exceptions.
  1976. -
  1977. - - Function: void mpf_div (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  1978. - - Function: void mpf_ui_div (mpf_t ROP, unsigned long int OP1, mpf_t
  1979. -          OP2)
  1980. - - Function: void mpf_div_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  1981. -          OP2)
  1982. -     Set ROP to OP1/OP2.
  1983. -
  1984. - - Function: void mpf_sqrt (mpf_t ROP, mpf_t OP)
  1985. - - Function: void mpf_sqrt_ui (mpf_t ROP, unsigned long int OP)
  1986. -     Set ROP to the square root of OP.
  1987. -
  1988. - - Function: void mpf_neg (mpf_t ROP, mpf_t OP)
  1989. -     Set ROP to -OP.
  1990. -
  1991. - - Function: void mpf_abs (mpf_t ROP, mpf_t OP)
  1992. -     Set ROP to the absolute value of OP.
  1993. -
  1994. - - Function: void mpf_mul_2exp (mpf_t ROP, mpf_t OP1, unsigned long int
  1995. -          OP2)
  1996. -     Set ROP to OP1 times 2 raised to OP2.
  1997. -
  1998. - - Function: void mpf_div_2exp (mpf_t ROP, mpf_t OP1, unsigned long int
  1999. -          OP2)
  2000. -     Set ROP to OP1 divided by 2 raised to OP2.
  2001. -
  2002. -
  2003. -File: gmp.info,  Node: Float Comparison,  Next: I/O of Floats,  Prev: Float Arithmetic,  Up: Floating-point Functions
  2004. -
  2005. -Comparison Functions
  2006. -====================
  2007. -
  2008. - - Function: int mpf_cmp (mpf_t OP1, mpf_t OP2)
  2009. - - Function: int mpf_cmp_ui (mpf_t OP1, unsigned long int OP2)
  2010. - - Function: int mpf_cmp_si (mpf_t OP1, signed long int OP2)
  2011. -     Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
  2012. -     if OP1 = OP2, and a negative value if OP1 < OP2.
  2013. -
  2014. - - Function: int mpf_eq (mpf_t OP1, mpf_t OP2, unsigned long int op3)
  2015. -     Return non-zero if the first OP3 bits of OP1 and OP2 are equal,
  2016. -     zero otherwise.  I.e., test of OP1 and OP2 are approximately equal.
  2017. -
  2018. - - Function: void mpf_reldiff (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  2019. -     Compute the relative difference between OP1 and OP2 and store the
  2020. -     result in ROP.
  2021. -
  2022. - - Macro: int mpf_sgn (mpf_t OP)
  2023. -     Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.
  2024. -
  2025. -     This function is actually implemented as a macro.  It evaluates its
  2026. -     arguments multiple times.
  2027. -
  2028. -
  2029. -File: gmp.info,  Node: I/O of Floats,  Next: Miscellaneous Float Functions,  Prev: Float Comparison,  Up: Floating-point Functions
  2030. -
  2031. -Input and Output Functions
  2032. -==========================
  2033. -
  2034. -   Functions that perform input from a stdio stream, and functions that
  2035. -output to a stdio stream.  Passing a NULL pointer for a STREAM argument
  2036. -to any of these functions will make them read from `stdin' and write to
  2037. -`stdout', respectively.
  2038. -
  2039. -   When using any of these functions, it is a good idea to include
  2040. -`stdio.h' before `gmp.h', since that will allow `gmp.h' to define
  2041. -prototypes for these functions.
  2042. -
  2043. - - Function: size_t mpf_out_str (FILE *STREAM, int BASE, size_t
  2044. -          N_DIGITS, mpf_t OP)
  2045. -     Output OP on stdio stream STREAM, as a string of digits in base
  2046. -     BASE.  The base may vary from 2 to 36.  Print at most N_DIGITS
  2047. -     significant digits, or if N_DIGITS is 0, the maximum number of
  2048. -     digits accurately representable by OP.
  2049. -
  2050. -     In addition to the significant digits, a leading `0.' and a
  2051. -     trailing exponent, in the form `eNNN', are printed.  If BASE is
  2052. -     greater than 10, `@' will be used instead of `e' as exponent
  2053. -     delimiter.
  2054. -
  2055. -     Return the number of bytes written, or if an error occurred,
  2056. -     return 0.
  2057. -
  2058. - - Function: size_t mpf_inp_str (mpf_t ROP, FILE *STREAM, int BASE)
  2059. -     Input a string in base BASE from stdio stream STREAM, and put the
  2060. -     read float in ROP.  The string is of the form `M@N' or, if the
  2061. -     base is 10 or less, alternatively `MeN'.  `M' is the mantissa and
  2062. -     `N' is the exponent.  The mantissa is always in the specified
  2063. -     base.  The exponent is either in the specified base or, if BASE is
  2064. -     negative, in decimal.
  2065. -
  2066. -     The argument BASE may be in the ranges 2 to 36, or -36 to -2.
  2067. -     Negative values are used to specify that the exponent is in
  2068. -     decimal.
  2069. -
  2070. -     Unlike the corresponding `mpz' function, the base will not be
  2071. -     determined from the leading characters of the string if BASE is 0.
  2072. -     This is so that numbers like `0.23' are not interpreted as octal.
  2073. -
  2074. -     Return the number of bytes read, or if an error occurred, return 0.
  2075. -
  2076. -
  2077. -File: gmp.info,  Node: Miscellaneous Float Functions,  Prev: I/O of Floats,  Up: Floating-point Functions
  2078. -
  2079. -Miscellaneous Functions
  2080. -=======================
  2081. -
  2082. - - Function: void mpf_random2 (mpf_t ROP, mp_size_t MAX_SIZE, mp_exp_t
  2083. -          MAX_EXP)
  2084. -     Generate a random float of at most MAX_SIZE limbs, with long
  2085. -     strings of zeros and ones in the binary representation.  The
  2086. -     exponent of the number is in the interval -EXP to EXP.  This
  2087. -     function is useful for testing functions and algorithms, since
  2088. -     this kind of random numbers have proven to be more likely to
  2089. -     trigger corner-case bugs.  Negative random numbers are generated
  2090. -     when MAX_SIZE is negative.
  2091. -
  2092. -
  2093. -File: gmp.info,  Node: Low-level Functions,  Next: BSD Compatible Functions,  Prev: Floating-point Functions,  Up: Top
  2094. -
  2095. -Low-level Functions
  2096. -*******************
  2097. -
  2098. -   This chapter describes low-level MP functions, used to implement the
  2099. -high-level MP functions, but also intended for time-critical user code.
  2100. -
  2101. -   These functions start with the prefix `mpn_'.
  2102. -
  2103. -   The `mpn' functions are designed to be as fast as possible, *not* to
  2104. -provide a coherent calling interface.  The different functions have
  2105. -somewhat similar interfaces, but there are variations that make them
  2106. -hard to use.  These functions do as little as possible apart from the
  2107. -real multiple precision computation, so that no time is spent on things
  2108. -that not all callers need.
  2109. -
  2110. -   A source operand is specified by a pointer to the least significant
  2111. -limb and a limb count.  A destination operand is specified by just a
  2112. -pointer.  It is the responsibility of the caller to ensure that the
  2113. -destination has enough space for storing the result.
  2114. -
  2115. -   With this way of specifying operands, it is possible to perform
  2116. -computations on subranges of an argument, and store the result into a
  2117. -subrange of a destination.
  2118. -
  2119. -   A common requirement for all functions is that each source area
  2120. -needs at least one limb.  No size argument may be zero.
  2121. -
  2122. -   The `mpn' functions is the base for the implementation of the `mpz_',
  2123. -`mpf_', and `mpq_' functions.
  2124. -
  2125. -   This example adds the number beginning at SRC1_PTR and the number
  2126. -beginning at SRC2_PTR and writes the sum at DEST_PTR.  All areas have
  2127. -SIZE limbs.
  2128. -
  2129. -     cy = mpn_add_n (dest_ptr, src1_ptr, src2_ptr, size)
  2130. -
  2131. -In the notation used here, a source operand is identified by the
  2132. -pointer to the least significant limb, and the limb count in braces.
  2133. -For example, {s1_ptr, s1_size}.
  2134. -
  2135. - - Function: mp_limb_t mpn_add_n (mp_limb_t * DEST_PTR, const mp_limb_t
  2136. -          * SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  2137. -     Add {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE}, and write the SIZE
  2138. -     least significant limbs of the result to DEST_PTR.  Return carry,
  2139. -     either 0 or 1.
  2140. -
  2141. -     This is the lowest-level function for addition.  It is the
  2142. -     preferred function for addition, since it is written in assembly
  2143. -     for most targets.  For addition of a variable to itself (i.e.,
  2144. -     SRC1_PTR equals SRC2_PTR, use `mpn_lshift' with a count of 1 for
  2145. -     optimal speed.
  2146. -
  2147. - - Function: mp_limb_t mpn_add_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  2148. -          * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  2149. -     Add {SRC1_PTR, SIZE} and SRC2_LIMB, and write the SIZE least
  2150. -     significant limbs of the result to DEST_PTR.  Return carry, either
  2151. -     0 or 1.
  2152. -
  2153. - - Function: mp_limb_t mpn_add (mp_limb_t * DEST_PTR, const mp_limb_t *
  2154. -          SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  2155. -          mp_size_t SRC2_SIZE)
  2156. -     Add {SRC1_PTR, SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}, and write the
  2157. -     SRC1_SIZE least significant limbs of the result to DEST_PTR.
  2158. -     Return carry, either 0 or 1.
  2159. -
  2160. -     This function requires that SRC1_SIZE is greater than or equal to
  2161. -     SRC2_SIZE.
  2162. -
  2163. - - Function: mp_limb_t mpn_sub_n (mp_limb_t * DEST_PTR, const mp_limb_t
  2164. -          * SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  2165. -     Subtract {SRC2_PTR, SRC2_SIZE} from {SRC1_PTR, SIZE}, and write
  2166. -     the SIZE least significant limbs of the result to DEST_PTR.
  2167. -     Return borrow, either 0 or 1.
  2168. -
  2169. -     This is the lowest-level function for subtraction.  It is the
  2170. -     preferred function for subtraction, since it is written in
  2171. -     assembly for most targets.
  2172. -
  2173. - - Function: mp_limb_t mpn_sub_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  2174. -          * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  2175. -     Subtract SRC2_LIMB from {SRC1_PTR, SIZE}, and write the SIZE least
  2176. -     significant limbs of the result to DEST_PTR.  Return borrow,
  2177. -     either 0 or 1.
  2178. -
  2179. - - Function: mp_limb_t mpn_sub (mp_limb_t * DEST_PTR, const mp_limb_t *
  2180. -          SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  2181. -          mp_size_t SRC2_SIZE)
  2182. -     Subtract {SRC2_PTR, SRC2_SIZE} from {SRC1_PTR, SRC1_SIZE}, and
  2183. -     write the SRC1_SIZE least significant limbs of the result to
  2184. -     DEST_PTR.  Return borrow, either 0 or 1.
  2185. -
  2186. -     This function requires that SRC1_SIZE is greater than or equal to
  2187. -     SRC2_SIZE.
  2188. -
  2189. - - Function: void mpn_mul_n (mp_limb_t * DEST_PTR, const mp_limb_t *
  2190. -          SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  2191. -     Multiply {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE}, and write the
  2192. -     *entire* result to DEST_PTR.
  2193. -
  2194. -     The destination has to have space for 2SIZE limbs, even if the
  2195. -     significant result might be one limb smaller.
  2196. -
  2197. - - Function: mp_limb_t mpn_mul_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  2198. -          * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  2199. -     Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and write the SIZE least
  2200. -     significant limbs of the product to DEST_PTR.  Return the most
  2201. -     significant limb of the product.
  2202. -
  2203. -     This is a low-level function that is a building block for general
  2204. -     multiplication as well as other operations in MP.  It is written
  2205. -     in assembly for most targets.
  2206. -
  2207. -     Don't call this function if SRC2_LIMB is a power of 2; use
  2208. -     `mpn_lshift' with a count equal to the logarithm of SRC2_LIMB
  2209. -     instead, for optimal speed.
  2210. -
  2211. - - Function: mp_limb_t mpn_addmul_1 (mp_limb_t * DEST_PTR, const
  2212. -          mp_limb_t * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  2213. -     Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and add the SIZE least
  2214. -     significant limbs of the product to {DEST_PTR, SIZE} and write the
  2215. -     result to DEST_PTR DEST_PTR.  Return the most significant limb of
  2216. -     the product, plus carry-out from the addition.
  2217. -
  2218. -     This is a low-level function that is a building block for general
  2219. -     multiplication as well as other operations in MP.  It is written
  2220. -     in assembly for most targets.
  2221. -
  2222. - - Function: mp_limb_t mpn_submul_1 (mp_limb_t * DEST_PTR, const
  2223. -          mp_limb_t * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  2224. -     Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and subtract the SIZE
  2225. -     least significant limbs of the product from {DEST_PTR, SIZE} and
  2226. -     write the result to DEST_PTR.  Return the most significant limb of
  2227. -     the product, minus borrow-out from the subtraction.
  2228. -
  2229. -     This is a low-level function that is a building block for general
  2230. -     multiplication and division as well as other operations in MP.  It
  2231. -     is written in assembly for most targets.
  2232. -
  2233. - - Function: mp_limb_t mpn_mul (mp_limb_t * DEST_PTR, const mp_limb_t *
  2234. -          SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  2235. -          mp_size_t SRC2_SIZE)
  2236. -     Multiply {SRC1_PTR, SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}, and
  2237. -     write the result to DEST_PTR.  Return the most significant limb of
  2238. -     the result.
  2239. -
  2240. -     The destination has to have space for SRC1_SIZE + SRC1_SIZE limbs,
  2241. -     even if the result might be one limb smaller.
  2242. -
  2243. -     This function requires that SRC1_SIZE is greater than or equal to
  2244. -     SRC2_SIZE.  The destination must be distinct from either input
  2245. -     operands.
  2246. -
  2247. - - Function: mp_size_t mpn_divrem (mp_limb_t * R1P, mp_size_t XSIZE,
  2248. -          mp_limb_t * RS2P, mp_size_t RS2SIZE, const mp_limb_t * S3P,
  2249. -          mp_size_t S3SIZE)
  2250. -     Divide {RS2P, RS2SIZE} by {S3P, S3SIZE}, and write the quotient at
  2251. -     R1P, with the exception of the most significant limb, which is
  2252. -     returned.  The remainder replaces the dividend at RS2P.
  2253. -
  2254. -     In addition to an integer quotient, XSIZE fraction limbs are
  2255. -     developed, and stored after the integral limbs.  For most usages,
  2256. -     XSIZE will be zero.
  2257. -
  2258. -     It is required that RS2SIZE is greater than or equal to S3SIZE.
  2259. -     It is required that the most significant bit of the divisor is set.
  2260. -
  2261. -     If the quotient is not needed, pass RS2P + S3SIZE as R1P.  Aside
  2262. -     from that special case, no overlap between arguments is permitted.
  2263. -
  2264. -     Return the most significant limb of the quotient, either 0 or 1.
  2265. -
  2266. -     The area at R1P needs to be RS2SIZE - S3SIZE + XSIZE limbs large.
  2267. -
  2268. - - Function: mp_limb_t mpn_divrem_1 (mp_limb_t * R1P, mp_size_t XSIZE,
  2269. -          mp_limb_t * S2P, mp_size_t S2SIZE, mp_limb_t S3LIMB)
  2270. -     Divide {S2P, S2SIZE} by S3LIMB, and write the quotient at R1P.
  2271. -     Return the remainder.
  2272. -
  2273. -     In addition to an integer quotient, XSIZE fraction limbs are
  2274. -     developed, and stored after the integral limbs.  For most usages,
  2275. -     XSIZE will be zero.
  2276. -
  2277. -     The areas at R1P and S2P have to be identical or completely
  2278. -     separate, not partially overlapping.
  2279. -
  2280. - - Function: mp_size_t mpn_divmod (mp_limb_t * R1P, mp_limb_t * RS2P,
  2281. -          mp_size_t RS2SIZE, const mp_limb_t * S3P, mp_size_t S3SIZE)
  2282. -     *This interface is obsolete.  It will disappear from future
  2283. -     releases.  Use `mpn_divrem' in its stead.*
  2284. -
  2285. - - Function: mp_limb_t mpn_divmod_1 (mp_limb_t * R1P, mp_limb_t * S2P,
  2286. -          mp_size_t S2SIZE, mp_limb_t S3LIMB)
  2287. -     *This interface is obsolete.  It will disappear from future
  2288. -     releases.  Use `mpn_divrem_1' in its stead.*
  2289. -
  2290. - - Function: mp_limb_t mpn_mod_1 (mp_limb_t * S1P, mp_size_t S1SIZE,
  2291. -          mp_limb_t S2LIMB)
  2292. -     Divide {S1P, S1SIZE} by S2LIMB, and return the remainder.
  2293. -
  2294. - - Function: mp_limb_t mpn_preinv_mod_1 (mp_limb_t * S1P, mp_size_t
  2295. -          S1SIZE, mp_limb_t S2LIMB, mp_limb_t S3LIMB)
  2296. -     *This interface is obsolete.  It will disappear from future
  2297. -     releases.  Use `mpn_mod_1' in its stead.*
  2298. -
  2299. - - Function: mp_limb_t mpn_bdivmod (mp_limb_t * DEST_PTR, mp_limb_t *
  2300. -          S1P, mp_size_t S1SIZE, const mp_limb_t * S2P, mp_size_t
  2301. -          S2SIZE, unsigned long int D)
  2302. -     The function puts the low [D/BITS_PER_MP_LIMB] limbs of Q = {S1P,
  2303. -     S1SIZE}/{S2P, S2SIZE} mod 2^D at DEST_PTR, and returns the high D
  2304. -     mod BITS_PER_MP_LIMB bits of Q.
  2305. -
  2306. -     {S1P, S1SIZE} - Q * {S2P, S2SIZE} mod 2^(S1SIZE*BITS_PER_MP_LIMB)
  2307. -     is placed at S1P.  Since the low [D/BITS_PER_MP_LIMB] limbs of
  2308. -     this difference are zero, it is possible to overwrite the low
  2309. -     limbs at S1P with this difference, provided DEST_PTR <= S1P.
  2310. -
  2311. -     This function requires that S1SIZE * BITS_PER_MP_LIMB >= D, and
  2312. -     that {S2P, S2SIZE} is odd.
  2313. -
  2314. -     *This interface is preliminary.  It might change incompatibly in
  2315. -     future revisions.*
  2316. -
  2317. - - Function: mp_limb_t mpn_lshift (mp_limb_t * DEST_PTR, const
  2318. -          mp_limb_t * SRC_PTR, mp_size_t SRC_SIZE, unsigned long int
  2319. -          COUNT)
  2320. -     Shift {SRC_PTR, SRC_SIZE} COUNT bits to the left, and write the
  2321. -     SRC_SIZE least significant limbs of the result to DEST_PTR.  COUNT
  2322. -     might be in the range 1 to n - 1, on an n-bit machine. The bits
  2323. -     shifted out to the left are returned.
  2324. -
  2325. -     Overlapping of the destination space and the source space is
  2326. -     allowed in this function, provided DEST_PTR >= SRC_PTR.
  2327. -
  2328. -     This function is written in assembly for most targets.
  2329. -
  2330. - - Function: mp_limp_t mpn_rshift (mp_limb_t * DEST_PTR, const
  2331. -          mp_limb_t * SRC_PTR, mp_size_t SRC_SIZE, unsigned long int
  2332. -          COUNT)
  2333. -     Shift {SRC_PTR, SRC_SIZE} COUNT bits to the right, and write the
  2334. -     SRC_SIZE most significant limbs of the result to DEST_PTR.  COUNT
  2335. -     might be in the range 1 to n - 1, on an n-bit machine.  The bits
  2336. -     shifted out to the right are returned.
  2337. -
  2338. -     Overlapping of the destination space and the source space is
  2339. -     allowed in this function, provided DEST_PTR <= SRC_PTR.
  2340. -
  2341. -     This function is written in assembly for most targets.
  2342. -
  2343. - - Function: int mpn_cmp (const mp_limb_t * SRC1_PTR, const mp_limb_t *
  2344. -          SRC2_PTR, mp_size_t SIZE)
  2345. -     Compare {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE} and return a
  2346. -     positive value if src1 > src2, 0 of they are equal, and a negative
  2347. -     value if src1 < src2.
  2348. -
  2349. - - Function: mp_size_t mpn_gcd (mp_limb_t * DEST_PTR, mp_limb_t *
  2350. -          SRC1_PTR, mp_size_t SRC1_SIZE, mp_limb_t * SRC2_PTR,
  2351. -          mp_size_t SRC2_SIZE)
  2352. -     Puts at DEST_PTR the greatest common divisor of {SRC1_PTR,
  2353. -     SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}; both source operands are
  2354. -     destroyed by the operation.  The size in limbs of the greatest
  2355. -     common divisor is returned.
  2356. -
  2357. -     {SRC1_PTR, SRC1_SIZE} must be odd, and {SRC2_PTR, SRC2_SIZE} must
  2358. -     have at least as many bits as {SRC1_PTR, SRC1_SIZE}.
  2359. -
  2360. -     *This interface is preliminary.  It might change incompatibly in
  2361. -     future revisions.*
  2362. -
  2363. - - Function: mp_limb_t mpn_gcd_1 (const mp_limb_t * SRC1_PTR, mp_size_t
  2364. -          SRC1_SIZE, mp_limb_t SRC2_LIMB)
  2365. -     Return the greatest common divisor of {SRC1_PTR, SRC1_SIZE} and
  2366. -     SRC2_LIMB, where SRC2_LIMB (as well as SRC1_SIZE) must be
  2367. -     different from 0.
  2368. -
  2369. - - Function: mp_size_t mpn_gcdext (mp_limb_t * R1P, mp_limb_t * R2P,
  2370. -          mp_limb_t * S1P, mp_size_t S1SIZE, mp_limb_t * S2P, mp_size_t
  2371. -          S2SIZE)
  2372. -     Puts at R1P the greatest common divisor of {S1P, S1SIZE} and {S2P,
  2373. -     S2SIZE}.  The first cofactor is written at R2P.  Both source
  2374. -     operands are destroyed by the operation.  The size in limbs of the
  2375. -     greatest common divisor is returned.
  2376. -
  2377. -     *This interface is preliminary.  It might change incompatibly in
  2378. -     future revisions.*
  2379. -
  2380. - - Function: mp_size_t mpn_sqrtrem (mp_limb_t * R1P, mp_limb_t * R2P,
  2381. -          const mp_limb_t * SP, mp_size_t SIZE)
  2382. -     Compute the square root of {SP, SIZE} and put the result at R1P.
  2383. -     Write the remainder at R2P, unless R2P is NULL.
  2384. -
  2385. -     Return the size of the remainder, whether R2P was NULL or non-NULL.
  2386. -     Iff the operand was a perfect square, the return value will be 0.
  2387. -
  2388. -     The areas at R1P and SP have to be distinct.  The areas at R2P and
  2389. -     SP have to be identical or completely separate, not partially
  2390. -     overlapping.
  2391. -
  2392. -     The area at R1P needs to have space for ceil(SIZE/2) limbs.  The
  2393. -     area at R2P needs to be SIZE limbs large.
  2394. -
  2395. -     *This interface is preliminary.  It might change incompatibly in
  2396. -     future revisions.*
  2397. -
  2398. - - Function: mp_size_t mpn_get_str (unsigned char *STR, int BASE,
  2399. -          mp_limb_t * S1P, mp_size_t S1SIZE)
  2400. -     Convert {S1P, S1SIZE} to a raw unsigned char array in base BASE.
  2401. -     The string is not in ASCII; to convert it to printable format, add
  2402. -     the ASCII codes for `0' or `A', depending on the base and range.
  2403. -     There may be leading zeros in the string.
  2404. -
  2405. -     The area at S1P is clobbered.
  2406. -
  2407. -     Return the number of characters in STR.
  2408. -
  2409. -     The area at STR has to have space for the largest possible number
  2410. -     represented by a S1SIZE long limb array, plus one extra character.
  2411. -
  2412. - - Function: mp_size_t mpn_set_str (mp_limb_t * R1P, const char *STR,
  2413. -          size_t strsize, int BASE)
  2414. -     Convert the raw unsigned char array at STR of length STRSIZE to a
  2415. -     limb array {S1P, S1SIZE}.  The base of STR is BASE.
  2416. -
  2417. -     Return the number of limbs stored in R1P.
  2418. -
  2419. - - Function: unsigned long int mpn_scan0 (const mp_limb_t * S1P,
  2420. -          unsigned long int BIT)
  2421. -     Scan S1P from bit position BIT for the next clear bit.
  2422. -
  2423. -     It is required that there be a clear bit within the area at S1P at
  2424. -     or beyond bit position BIT, so that the function has something to
  2425. -     return.
  2426. -
  2427. -     *This interface is preliminary.  It might change incompatibly in
  2428. -     future revisions.*
  2429. -
  2430. - - Function: unsigned long int mpn_scan1 (const mp_limb_t * S1P,
  2431. -          unsigned long int BIT)
  2432. -     Scan S1P from bit position BIT for the next set bit.
  2433. -
  2434. -     It is required that there be a set bit within the area at S1P at or
  2435. -     beyond bit position BIT, so that the function has something to
  2436. -     return.
  2437. -
  2438. -     *This interface is preliminary.  It might change incompatibly in
  2439. -     future revisions.*
  2440. -
  2441. - - Function: void mpn_random2 (mp_limb_t * R1P, mp_size_t R1SIZE)
  2442. -     Generate a random number of length R1SIZE with long strings of
  2443. -     zeros and ones in the binary representation, and store it at R1P.
  2444. -
  2445. -     The generated random numbers are intended for testing the
  2446. -     correctness of the implementation of the `mpn' routines.
  2447. -
  2448. - - Function: unsigned long int mpn_popcount (const mp_limb_t * S1P,
  2449. -          unsigned long int SIZE)
  2450. -     Count the number of set bits in {S1P, SIZE}.
  2451. -
  2452. - - Function: unsigned long int mpn_hamdist (const mp_limb_t * S1P,
  2453. -          const mp_limb_t * S2P, unsigned long int SIZE)
  2454. -     Compute the hamming distance between {S1P, SIZE} and {S2P, SIZE}.
  2455. -
  2456. - - Function: int mpn_perfect_square_p (const mp_limb_t * S1P, mp_size_t
  2457. -          SIZE)
  2458. -     Return non-zero iff {S1P, SIZE} is a perfect square.
  2459. -
  2460. -
  2461. -File: gmp.info,  Node: BSD Compatible Functions,  Next: Custom Allocation,  Prev: Low-level Functions,  Up: Top
  2462. -
  2463. -Berkeley MP Compatible Functions
  2464. -********************************
  2465. -
  2466. -   These functions are intended to be fully compatible with the
  2467. -Berkeley MP library which is available on many BSD derived U*ix systems.
  2468. -
  2469. -   The original Berkeley MP library has a usage restriction: you cannot
  2470. -use the same variable as both source and destination in a single
  2471. -function call.  The compatible functions in GNU MP do not share this
  2472. -restriction--inputs and outputs may overlap.
  2473. -
  2474. -   It is not recommended that new programs are written using these
  2475. -functions.  Apart from the incomplete set of functions, the interface
  2476. -for initializing `MINT' objects is more error prone, and the `pow'
  2477. -function collides with `pow' in `libm.a'.
  2478. -
  2479. -   Include the header `mp.h' to get the definition of the necessary
  2480. -types and functions.  If you are on a BSD derived system, make sure to
  2481. -include GNU `mp.h' if you are going to link the GNU `libmp.a' to you
  2482. -program.  This means that you probably need to give the -I<dir> option
  2483. -to the compiler, where <dir> is the directory where you have GNU `mp.h'.
  2484. -
  2485. - - Function: MINT * itom (signed short int INITIAL_VALUE)
  2486. -     Allocate an integer consisting of a `MINT' object and dynamic limb
  2487. -     space.  Initialize the integer to INITIAL_VALUE.  Return a pointer
  2488. -     to the `MINT' object.
  2489. -
  2490. - - Function: MINT * xtom (char *INITIAL_VALUE)
  2491. -     Allocate an integer consisting of a `MINT' object and dynamic limb
  2492. -     space.  Initialize the integer from INITIAL_VALUE, a hexadecimal,
  2493. -     '\0'-terminate C string.  Return a pointer to the `MINT' object.
  2494. -
  2495. - - Function: void move (MINT *SRC, MINT *DEST)
  2496. -     Set DEST to SRC by copying.  Both variables must be previously
  2497. -     initialized.
  2498. -
  2499. - - Function: void madd (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  2500. -     Add SRC_1 and SRC_2 and put the sum in DESTINATION.
  2501. -
  2502. - - Function: void msub (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  2503. -     Subtract SRC_2 from SRC_1 and put the difference in DESTINATION.
  2504. -
  2505. - - Function: void mult (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  2506. -     Multiply SRC_1 and SRC_2 and put the product in DESTINATION.
  2507. -
  2508. - - Function: void mdiv (MINT *DIVIDEND, MINT *DIVISOR, MINT *QUOTIENT,
  2509. -          MINT *REMAINDER)
  2510. - - Function: void sdiv (MINT *DIVIDEND, signed short int DIVISOR, MINT
  2511. -          *QUOTIENT, signed short int *REMAINDER)
  2512. -     Set QUOTIENT to DIVIDEND/DIVISOR, and REMAINDER to DIVIDEND mod
  2513. -     DIVISOR.  The quotient is rounded towards zero; the remainder has
  2514. -     the same sign as the dividend unless it is zero.
  2515. -
  2516. -     Some implementations of these functions work differently--or not
  2517. -     at all--for negative arguments.
  2518. -
  2519. - - Function: void msqrt (MINT *OPERAND, MINT *ROOT, MINT *REMAINDER)
  2520. -     Set ROOT to the truncated integer part of the square root of
  2521. -     OPERAND.  Set REMAINDER to OPERAND-ROOT*ROOT, (i.e., zero if
  2522. -     OPERAND is a perfect square).
  2523. -
  2524. -     If ROOT and REMAINDER are the same variable, the results are
  2525. -     undefined.
  2526. -
  2527. - - Function: void pow (MINT *BASE, MINT *EXP, MINT *MOD, MINT *DEST)
  2528. -     Set DEST to (BASE raised to EXP) modulo MOD.
  2529. -
  2530. - - Function: void rpow (MINT *BASE, signed short int EXP, MINT *DEST)
  2531. -     Set DEST to BASE raised to EXP.
  2532. -
  2533. - - Function: void gcd (MINT *OPERAND1, MINT *OPERAND2, MINT *RES)
  2534. -     Set RES to the greatest common divisor of OPERAND1 and OPERAND2.
  2535. -
  2536. - - Function: int mcmp (MINT *OPERAND1, MINT *OPERAND2)
  2537. -     Compare OPERAND1 and OPERAND2.  Return a positive value if
  2538. -     OPERAND1 > OPERAND2, zero if OPERAND1 = OPERAND2, and a negative
  2539. -     value if OPERAND1 < OPERAND2.
  2540. -
  2541. - - Function: void min (MINT *DEST)
  2542. -     Input a decimal string from `stdin', and put the read integer in
  2543. -     DEST.  SPC and TAB are allowed in the number string, and are
  2544. -     ignored.
  2545. -
  2546. - - Function: void mout (MINT *SRC)
  2547. -     Output SRC to `stdout', as a decimal string.  Also output a
  2548. -     newline.
  2549. -
  2550. - - Function: char * mtox (MINT *OPERAND)
  2551. -     Convert OPERAND to a hexadecimal string, and return a pointer to
  2552. -     the string.  The returned string is allocated using the default
  2553. -     memory allocation function, `malloc' by default.
  2554. -
  2555. - - Function: void mfree (MINT *OPERAND)
  2556. -     De-allocate, the space used by OPERAND.  *This function should
  2557. -     only be passed a value returned by `itom' or `xtom'.*
  2558. -
  2559. -
  2560. -File: gmp.info,  Node: Custom Allocation,  Next: Contributors,  Prev: BSD Compatible Functions,  Up: Top
  2561. -
  2562. -Custom Allocation
  2563. -*****************
  2564. -
  2565. -   By default, the MP functions use `malloc', `realloc', and `free' for
  2566. -memory allocation.  If `malloc' or `realloc' fails, the MP library
  2567. -terminates execution after printing a fatal error message to standard
  2568. -error.
  2569. -
  2570. -   For some applications, you may wish to allocate memory in other
  2571. -ways, or you may not want to have a fatal error when there is no more
  2572. -memory available.  To accomplish this, you can specify alternative
  2573. -memory allocation functions.
  2574. -
  2575. - - Function: void mp_set_memory_functions (
  2576. -          void *(*ALLOC_FUNC_PTR) (size_t),
  2577. -          void *(*REALLOC_FUNC_PTR) (void *, size_t, size_t),
  2578. -          void (*FREE_FUNC_PTR) (void *, size_t))
  2579. -     Replace the current allocation functions from the arguments.  If
  2580. -     an argument is NULL, the corresponding default function is
  2581. -     retained.
  2582. -
  2583. -     *Make sure to call this function in such a way that there are no
  2584. -     active MP objects that were allocated using the previously active
  2585. -     allocation function!  Usually, that means that you have to call
  2586. -     this function before any other MP function.*
  2587. -
  2588. -   The functions you supply should fit the following declarations:
  2589. -
  2590. - - Function: void * allocate_function (size_t ALLOC_SIZE)
  2591. -     This function should return a pointer to newly allocated space
  2592. -     with at least ALLOC_SIZE storage units.
  2593. -
  2594. - - Function: void * reallocate_function (void *PTR, size_t OLD_SIZE,
  2595. -          size_t NEW_SIZE)
  2596. -     This function should return a pointer to newly allocated space of
  2597. -     at least NEW_SIZE storage units, after copying at least the first
  2598. -     OLD_SIZE storage units from PTR.  It should also de-allocate the
  2599. -     space at PTR.
  2600. -
  2601. -     You can assume that the space at PTR was formerly returned from
  2602. -     `allocate_function' or `reallocate_function', for a request for
  2603. -     OLD_SIZE storage units.
  2604. -
  2605. - - Function: void deallocate_function (void *PTR, size_t SIZE)
  2606. -     De-allocate the space pointed to by PTR.
  2607. -
  2608. -     You can assume that the space at PTR was formerly returned from
  2609. -     `allocate_function' or `reallocate_function', for a request for
  2610. -     SIZE storage units.
  2611. -
  2612. -   (A "storage unit" is the unit in which the `sizeof' operator returns
  2613. -the size of an object, normally an 8 bit byte.)
  2614. -
  2615. -
  2616. -File: gmp.info,  Node: Contributors,  Next: References,  Prev: Custom Allocation,  Up: Top
  2617. -
  2618. -Contributors
  2619. -************
  2620. -
  2621. -   I would like to thank Gunnar Sjoedin and Hans Riesel for their help
  2622. -with mathematical problems, Richard Stallman for his help with design
  2623. -issues and for revising the first version of this manual, Brian Beuning
  2624. -and Doug Lea for their testing of early versions of the library.
  2625. -
  2626. -   John Amanatides of York University in Canada contributed the function
  2627. -`mpz_probab_prime_p'.
  2628. -
  2629. -   Paul Zimmermann of Inria sparked the development of GMP 2, with his
  2630. -comparisons between bignum packages.
  2631. -
  2632. -   Ken Weber (Kent State University, Universidade Federal do Rio Grande
  2633. -do Sul) contributed `mpz_gcd', `mpz_divexact', `mpn_gcd', and
  2634. -`mpn_bdivmod', partially supported by CNPq (Brazil) grant 301314194-2.
  2635. -
  2636. -   Per Bothner of Cygnus Support helped to set up MP to use Cygnus'
  2637. -configure.  He has also made valuable suggestions and tested numerous
  2638. -intermediary releases.
  2639. -
  2640. -   Joachim Hollman was involved in the design of the `mpf' interface,
  2641. -and in the `mpz' design revisions for version 2.
  2642. -
  2643. -   Bennet Yee contributed the functions `mpz_jacobi' and `mpz_legendre'.
  2644. -
  2645. -   Andreas Schwab contributed the files `mpn/m68k/lshift.S' and
  2646. -`mpn/m68k/rshift.S'.
  2647. -
  2648. -   The development of floating point functions of GNU MP 2, were
  2649. -supported in part by the ESPRIT-BRA (Basic Research Activities) 6846
  2650. -project POSSO (POlynomial System SOlving).
  2651. -
  2652. -   GNU MP 2 was finished and released by TMG Datakonsult,
  2653. -Sodermannagatan 5, 116 23 STOCKHOLM, SWEDEN, in cooperation with the
  2654. -IDA Center for Computing Sciences, USA.
  2655. -
  2656. -
  2657. -File: gmp.info,  Node: References,  Prev: Contributors,  Up: Top
  2658. -
  2659. -References
  2660. -**********
  2661. -
  2662. -   * Donald E. Knuth, "The Art of Computer Programming", vol 2,
  2663. -     "Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981.
  2664. -
  2665. -   * John D. Lipson, "Elements of Algebra and Algebraic Computing", The
  2666. -     Benjamin Cummings Publishing Company Inc, 1981.
  2667. -
  2668. -   * Richard M. Stallman, "Using and Porting GCC", Free Software
  2669. -     Foundation, 1995.
  2670. -
  2671. -   * Peter L. Montgomery, "Modular Multiplication Without Trial
  2672. -     Division", in Mathematics of Computation, volume 44, number 170,
  2673. -     April 1985.
  2674. -
  2675. -   * Torbjorn Granlund and Peter L. Montgomery, "Division by Invariant
  2676. -     Integers using Multiplication", in Proceedings of the SIGPLAN
  2677. -     PLDI'94 Conference, June 1994.
  2678. -
  2679. -   * Tudor Jebelean, "An algorithm for exact division", Journal of
  2680. -     Symbolic Computation, v. 15, 1993, pp. 169-180.
  2681. -
  2682. -   * Kenneth Weber, "The accelerated integer GCD algorithm", ACM
  2683. -     Transactions on Mathematical Software, v. 21 (March), 1995, pp.
  2684. -     111-122.
  2685. -
  2686. -
  2687. -File: gmp.info,  Node: Concept Index,  Up: Top
  2688. -
  2689. -Concept Index
  2690. -*************
  2691. -
  2692. -* Menu:
  2693. -
  2694. -* gmp.h:                                MP Basics.
  2695. -* mp.h:                                 BSD Compatible Functions.
  2696. -* Arithmetic functions <1>:             Float Arithmetic.
  2697. -* Arithmetic functions:                 Integer Arithmetic.
  2698. -* Bit manipulation functions:           Integer Logic and Bit Fiddling.
  2699. -* BSD MP compatible functions:          BSD Compatible Functions.
  2700. -* Comparison functions:                 Float Comparison.
  2701. -* Conditions for copying GNU MP:        Copying.
  2702. -* Conversion functions <1>:             Converting Integers.
  2703. -* Conversion functions:                 Converting Floats.
  2704. -* Copying conditions:                   Copying.
  2705. -* Float arithmetic functions:           Float Arithmetic.
  2706. -* Float assignment functions:           Assigning Floats.
  2707. -* Float comparisons functions:          Float Comparison.
  2708. -* Float functions:                      Floating-point Functions.
  2709. -* Float input and output functions:     I/O of Floats.
  2710. -* Floating-point functions:             Floating-point Functions.
  2711. -* Floating-point number:                MP Basics.
  2712. -* I/O functions <1>:                    I/O of Floats.
  2713. -* I/O functions:                        I/O of Integers.
  2714. -* Initialization and assignment functions <1>: Simultaneous Float Init & Assign.
  2715. -* Initialization and assignment functions: Simultaneous Integer Init & Assign.
  2716. -* Input functions <1>:                  I/O of Integers.
  2717. -* Input functions:                      I/O of Floats.
  2718. -* Installation:                         Installing MP.
  2719. -* Integer:                              MP Basics.
  2720. -* Integer arithmetic functions:         Integer Arithmetic.
  2721. -* Integer assignment functions:         Assigning Integers.
  2722. -* Integer conversion functions:         Converting Integers.
  2723. -* Integer functions:                    Integer Functions.
  2724. -* Integer input and output functions:   I/O of Integers.
  2725. -* Limb:                                 MP Basics.
  2726. -* Logical functions:                    Integer Logic and Bit Fiddling.
  2727. -* Low-level functions:                  Low-level Functions.
  2728. -* Miscellaneous float functions:        Miscellaneous Float Functions.
  2729. -* Miscellaneous integer functions:      Miscellaneous Integer Functions.
  2730. -* Output functions <1>:                 I/O of Floats.
  2731. -* Output functions:                     I/O of Integers.
  2732. -* Rational number:                      MP Basics.
  2733. -* Rational number functions:            Rational Number Functions.
  2734. -* Reporting bugs:                       Reporting Bugs.
  2735. -* User-defined precision:               Floating-point Functions.
  2736. -
  2737. diff -rup --new-file baseline/fsf/gmp/gmp.info-3 amiga/fsf/gmp/gmp.info-3
  2738. --- baseline/fsf/gmp/gmp.info-3    Thu Jun  6 12:30:58 1996
  2739. +++ amiga/fsf/gmp/gmp.info-3    Wed Dec 31 17:00:00 1969
  2740. @@ -1,259 +0,0 @@
  2741. -This is Info file gmp.info, produced by Makeinfo-1.64 from the input
  2742. -file gmp.texi.
  2743. -
  2744. -START-INFO-DIR-ENTRY
  2745. -* gmp: (gmp.info).               GNU Multiple Precision Arithmetic Library.
  2746. -END-INFO-DIR-ENTRY
  2747. -
  2748. -   This file documents GNU MP, a library for arbitrary-precision
  2749. -arithmetic.
  2750. -
  2751. -   Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation,
  2752. -Inc.
  2753. -
  2754. -   Permission is granted to make and distribute verbatim copies of this
  2755. -manual provided the copyright notice and this permission notice are
  2756. -preserved on all copies.
  2757. -
  2758. -   Permission is granted to copy and distribute modified versions of
  2759. -this manual under the conditions for verbatim copying, provided that
  2760. -the entire resulting derived work is distributed under the terms of a
  2761. -permission notice identical to this one.
  2762. -
  2763. -   Permission is granted to copy and distribute translations of this
  2764. -manual into another language, under the above conditions for modified
  2765. -versions, except that this permission notice may be stated in a
  2766. -translation approved by the Foundation.
  2767. -
  2768. -
  2769. -File: gmp.info,  Node: Function Index,  Up: Top
  2770. -
  2771. -Function and Type Index
  2772. -***********************
  2773. -
  2774. -* Menu:
  2775. -
  2776. -* mp_limb_t:                            MP Basics.
  2777. -* mpf_t:                                MP Basics.
  2778. -* mpq_t:                                MP Basics.
  2779. -* mpz_t:                                MP Basics.
  2780. -* __GNU_MP_VERSION:                     MP Basics.
  2781. -* __GNU_MP_VERSION_MINOR:               MP Basics.
  2782. -* _mpz_realloc:                         Initializing Integers.
  2783. -* allocate_function:                    Custom Allocation.
  2784. -* deallocate_function:                  Custom Allocation.
  2785. -* gcd:                                  BSD Compatible Functions.
  2786. -* itom:                                 BSD Compatible Functions.
  2787. -* madd:                                 BSD Compatible Functions.
  2788. -* mcmp:                                 BSD Compatible Functions.
  2789. -* mdiv:                                 BSD Compatible Functions.
  2790. -* mfree:                                BSD Compatible Functions.
  2791. -* min:                                  BSD Compatible Functions.
  2792. -* mout:                                 BSD Compatible Functions.
  2793. -* move:                                 BSD Compatible Functions.
  2794. -* mp_set_memory_functions:              Custom Allocation.
  2795. -* mpf_abs:                              Float Arithmetic.
  2796. -* mpf_add:                              Float Arithmetic.
  2797. -* mpf_add_ui:                           Float Arithmetic.
  2798. -* mpf_clear:                            Initializing Floats.
  2799. -* mpf_cmp:                              Float Comparison.
  2800. -* mpf_cmp_si:                           Float Comparison.
  2801. -* mpf_cmp_ui:                           Float Comparison.
  2802. -* mpf_div:                              Float Arithmetic.
  2803. -* mpf_div_2exp:                         Float Arithmetic.
  2804. -* mpf_div_ui:                           Float Arithmetic.
  2805. -* mpf_eq:                               Float Comparison.
  2806. -* mpf_get_d:                            Converting Floats.
  2807. -* mpf_get_prec:                         Initializing Floats.
  2808. -* mpf_get_str:                          Converting Floats.
  2809. -* mpf_init:                             Initializing Floats.
  2810. -* mpf_init2:                            Initializing Floats.
  2811. -* mpf_init_set:                         Simultaneous Float Init & Assign.
  2812. -* mpf_init_set_d:                       Simultaneous Float Init & Assign.
  2813. -* mpf_init_set_si:                      Simultaneous Float Init & Assign.
  2814. -* mpf_init_set_str:                     Simultaneous Float Init & Assign.
  2815. -* mpf_init_set_ui:                      Simultaneous Float Init & Assign.
  2816. -* mpf_inp_str:                          I/O of Floats.
  2817. -* mpf_mul:                              Float Arithmetic.
  2818. -* mpf_mul_2exp:                         Float Arithmetic.
  2819. -* mpf_mul_ui:                           Float Arithmetic.
  2820. -* mpf_neg:                              Float Arithmetic.
  2821. -* mpf_out_str:                          I/O of Floats.
  2822. -* mpf_random2:                          Miscellaneous Float Functions.
  2823. -* mpf_reldiff:                          Float Comparison.
  2824. -* mpf_set:                              Assigning Floats.
  2825. -* mpf_set_d:                            Assigning Floats.
  2826. -* mpf_set_default_prec:                 Initializing Floats.
  2827. -* mpf_set_prec:                         Initializing Floats.
  2828. -* mpf_set_prec_raw:                     Initializing Floats.
  2829. -* mpf_set_q:                            Assigning Floats.
  2830. -* mpf_set_si:                           Assigning Floats.
  2831. -* mpf_set_str:                          Assigning Floats.
  2832. -* mpf_set_ui:                           Assigning Floats.
  2833. -* mpf_set_z:                            Assigning Floats.
  2834. -* mpf_sgn:                              Float Comparison.
  2835. -* mpf_sqrt:                             Float Arithmetic.
  2836. -* mpf_sqrt_ui:                          Float Arithmetic.
  2837. -* mpf_sub:                              Float Arithmetic.
  2838. -* mpf_sub_ui:                           Float Arithmetic.
  2839. -* mpf_ui_div:                           Float Arithmetic.
  2840. -* mpf_ui_sub:                           Float Arithmetic.
  2841. -* mpn_add:                              Low-level Functions.
  2842. -* mpn_add_1:                            Low-level Functions.
  2843. -* mpn_add_n:                            Low-level Functions.
  2844. -* mpn_addmul_1:                         Low-level Functions.
  2845. -* mpn_bdivmod:                          Low-level Functions.
  2846. -* mpn_cmp:                              Low-level Functions.
  2847. -* mpn_divmod:                           Low-level Functions.
  2848. -* mpn_divmod_1:                         Low-level Functions.
  2849. -* mpn_divrem:                           Low-level Functions.
  2850. -* mpn_divrem_1:                         Low-level Functions.
  2851. -* mpn_gcd:                              Low-level Functions.
  2852. -* mpn_gcd_1:                            Low-level Functions.
  2853. -* mpn_gcdext:                           Low-level Functions.
  2854. -* mpn_get_str:                          Low-level Functions.
  2855. -* mpn_hamdist:                          Low-level Functions.
  2856. -* mpn_lshift:                           Low-level Functions.
  2857. -* mpn_mod_1:                            Low-level Functions.
  2858. -* mpn_mul:                              Low-level Functions.
  2859. -* mpn_mul_1:                            Low-level Functions.
  2860. -* mpn_mul_n:                            Low-level Functions.
  2861. -* mpn_perfect_square_p:                 Low-level Functions.
  2862. -* mpn_popcount:                         Low-level Functions.
  2863. -* mpn_preinv_mod_1:                     Low-level Functions.
  2864. -* mpn_random2:                          Low-level Functions.
  2865. -* mpn_rshift:                           Low-level Functions.
  2866. -* mpn_scan0:                            Low-level Functions.
  2867. -* mpn_scan1:                            Low-level Functions.
  2868. -* mpn_set_str:                          Low-level Functions.
  2869. -* mpn_sqrtrem:                          Low-level Functions.
  2870. -* mpn_sub:                              Low-level Functions.
  2871. -* mpn_sub_1:                            Low-level Functions.
  2872. -* mpn_sub_n:                            Low-level Functions.
  2873. -* mpn_submul_1:                         Low-level Functions.
  2874. -* mpq_add:                              Assigning Rationals.
  2875. -* mpq_canonicalize:                     Rational Number Functions.
  2876. -* mpq_clear:                            Initializing Rationals.
  2877. -* mpq_cmp:                              Comparing Rationals.
  2878. -* mpq_cmp_ui:                           Comparing Rationals.
  2879. -* mpq_denref:                           Applying Integer Functions.
  2880. -* mpq_div:                              Assigning Rationals.
  2881. -* mpq_equal:                            Comparing Rationals.
  2882. -* mpq_get_d:                            Miscellaneous Rational Functions.
  2883. -* mpq_get_den:                          Miscellaneous Rational Functions.
  2884. -* mpq_get_num:                          Miscellaneous Rational Functions.
  2885. -* mpq_init:                             Initializing Rationals.
  2886. -* mpq_inv:                              Assigning Rationals.
  2887. -* mpq_mul:                              Assigning Rationals.
  2888. -* mpq_neg:                              Assigning Rationals.
  2889. -* mpq_numref:                           Applying Integer Functions.
  2890. -* mpq_set:                              Initializing Rationals.
  2891. -* mpq_set_den:                          Miscellaneous Rational Functions.
  2892. -* mpq_set_num:                          Miscellaneous Rational Functions.
  2893. -* mpq_set_si:                           Initializing Rationals.
  2894. -* mpq_set_ui:                           Initializing Rationals.
  2895. -* mpq_set_z:                            Initializing Rationals.
  2896. -* mpq_sgn:                              Comparing Rationals.
  2897. -* mpq_sub:                              Assigning Rationals.
  2898. -* mpz_abs:                              Integer Arithmetic.
  2899. -* mpz_add:                              Integer Arithmetic.
  2900. -* mpz_add_ui:                           Integer Arithmetic.
  2901. -* mpz_and:                              Integer Logic and Bit Fiddling.
  2902. -* mpz_array_init:                       Initializing Integers.
  2903. -* mpz_cdiv_q:                           Integer Arithmetic.
  2904. -* mpz_cdiv_q_ui:                        Integer Arithmetic.
  2905. -* mpz_cdiv_qr:                          Integer Arithmetic.
  2906. -* mpz_cdiv_qr_ui:                       Integer Arithmetic.
  2907. -* mpz_cdiv_r:                           Integer Arithmetic.
  2908. -* mpz_cdiv_r_ui:                        Integer Arithmetic.
  2909. -* mpz_cdiv_ui:                          Integer Arithmetic.
  2910. -* mpz_clear:                            Initializing Integers.
  2911. -* mpz_clrbit:                           Integer Logic and Bit Fiddling.
  2912. -* mpz_cmp:                              Comparison Functions.
  2913. -* mpz_cmp_si:                           Comparison Functions.
  2914. -* mpz_cmp_ui:                           Comparison Functions.
  2915. -* mpz_com:                              Integer Logic and Bit Fiddling.
  2916. -* mpz_divexact:                         Integer Arithmetic.
  2917. -* mpz_fac_ui:                           Integer Arithmetic.
  2918. -* mpz_fdiv_q:                           Integer Arithmetic.
  2919. -* mpz_fdiv_q_2exp:                      Integer Arithmetic.
  2920. -* mpz_fdiv_q_ui:                        Integer Arithmetic.
  2921. -* mpz_fdiv_qr:                          Integer Arithmetic.
  2922. -* mpz_fdiv_qr_ui:                       Integer Arithmetic.
  2923. -* mpz_fdiv_r:                           Integer Arithmetic.
  2924. -* mpz_fdiv_r_2exp:                      Integer Arithmetic.
  2925. -* mpz_fdiv_r_ui:                        Integer Arithmetic.
  2926. -* mpz_fdiv_ui:                          Integer Arithmetic.
  2927. -* mpz_gcd:                              Integer Arithmetic.
  2928. -* mpz_gcd_ui:                           Integer Arithmetic.
  2929. -* mpz_gcdext:                           Integer Arithmetic.
  2930. -* mpz_get_d:                            Converting Integers.
  2931. -* mpz_get_si:                           Converting Integers.
  2932. -* mpz_get_str:                          Converting Integers.
  2933. -* mpz_get_ui:                           Converting Integers.
  2934. -* mpz_hamdist:                          Integer Logic and Bit Fiddling.
  2935. -* mpz_init:                             Initializing Integers.
  2936. -* mpz_init_set:                         Simultaneous Integer Init & Assign.
  2937. -* mpz_init_set_d:                       Simultaneous Integer Init & Assign.
  2938. -* mpz_init_set_si:                      Simultaneous Integer Init & Assign.
  2939. -* mpz_init_set_str:                     Simultaneous Integer Init & Assign.
  2940. -* mpz_init_set_ui:                      Simultaneous Integer Init & Assign.
  2941. -* mpz_inp_raw:                          I/O of Integers.
  2942. -* mpz_inp_str:                          I/O of Integers.
  2943. -* mpz_invert:                           Integer Arithmetic.
  2944. -* mpz_ior:                              Integer Logic and Bit Fiddling.
  2945. -* mpz_jacobi:                           Integer Arithmetic.
  2946. -* mpz_legendre:                         Integer Arithmetic.
  2947. -* mpz_mod:                              Integer Arithmetic.
  2948. -* mpz_mod_ui:                           Integer Arithmetic.
  2949. -* mpz_mul:                              Integer Arithmetic.
  2950. -* mpz_mul_2exp:                         Integer Arithmetic.
  2951. -* mpz_mul_ui:                           Integer Arithmetic.
  2952. -* mpz_neg:                              Integer Arithmetic.
  2953. -* mpz_out_raw:                          I/O of Integers.
  2954. -* mpz_out_str:                          I/O of Integers.
  2955. -* mpz_perfect_square_p:                 Integer Arithmetic.
  2956. -* mpz_popcount:                         Integer Logic and Bit Fiddling.
  2957. -* mpz_pow_ui:                           Integer Arithmetic.
  2958. -* mpz_powm:                             Integer Arithmetic.
  2959. -* mpz_powm_ui:                          Integer Arithmetic.
  2960. -* mpz_probab_prime_p:                   Integer Arithmetic.
  2961. -* mpz_random:                           Miscellaneous Integer Functions.
  2962. -* mpz_random2:                          Miscellaneous Integer Functions.
  2963. -* mpz_scan0:                            Integer Logic and Bit Fiddling.
  2964. -* mpz_scan1:                            Integer Logic and Bit Fiddling.
  2965. -* mpz_set:                              Assigning Integers.
  2966. -* mpz_set_d:                            Assigning Integers.
  2967. -* mpz_set_f:                            Assigning Integers.
  2968. -* mpz_set_q:                            Assigning Integers.
  2969. -* mpz_set_si:                           Assigning Integers.
  2970. -* mpz_set_str:                          Assigning Integers.
  2971. -* mpz_set_ui:                           Assigning Integers.
  2972. -* mpz_setbit:                           Integer Logic and Bit Fiddling.
  2973. -* mpz_sgn:                              Comparison Functions.
  2974. -* mpz_size:                             Miscellaneous Integer Functions.
  2975. -* mpz_sizeinbase:                       Miscellaneous Integer Functions.
  2976. -* mpz_sqrt:                             Integer Arithmetic.
  2977. -* mpz_sqrtrem:                          Integer Arithmetic.
  2978. -* mpz_sub:                              Integer Arithmetic.
  2979. -* mpz_sub_ui:                           Integer Arithmetic.
  2980. -* mpz_tdiv_q:                           Integer Arithmetic.
  2981. -* mpz_tdiv_q_2exp:                      Integer Arithmetic.
  2982. -* mpz_tdiv_q_ui:                        Integer Arithmetic.
  2983. -* mpz_tdiv_qr:                          Integer Arithmetic.
  2984. -* mpz_tdiv_qr_ui:                       Integer Arithmetic.
  2985. -* mpz_tdiv_r:                           Integer Arithmetic.
  2986. -* mpz_tdiv_r_2exp:                      Integer Arithmetic.
  2987. -* mpz_tdiv_r_ui:                        Integer Arithmetic.
  2988. -* mpz_ui_pow_ui:                        Integer Arithmetic.
  2989. -* msqrt:                                BSD Compatible Functions.
  2990. -* msub:                                 BSD Compatible Functions.
  2991. -* mtox:                                 BSD Compatible Functions.
  2992. -* mult:                                 BSD Compatible Functions.
  2993. -* pow:                                  BSD Compatible Functions.
  2994. -* reallocate_function:                  Custom Allocation.
  2995. -* rpow:                                 BSD Compatible Functions.
  2996. -* sdiv:                                 BSD Compatible Functions.
  2997. -* xtom:                                 BSD Compatible Functions.
  2998. -
  2999. -
  3000. diff -rup --new-file baseline/fsf/gmp/manifests/bin amiga/fsf/gmp/manifests/bin
  3001. --- baseline/fsf/gmp/manifests/bin    Wed Dec 31 17:00:00 1969
  3002. +++ amiga/fsf/gmp/manifests/bin    Sat Sep 28 00:00:00 1996
  3003. @@ -0,0 +1,10 @@
  3004. +COPYING
  3005. +COPYING.info
  3006. +dvi/gmp.dvi
  3007. +guide/gmp.guide
  3008. +include/gmp.h
  3009. +include/mp.h
  3010. +info/gmp.info
  3011. +lib/libgmp.a
  3012. +lib/libmp.a
  3013. +ps/gmp.ps
  3014. diff -rup --new-file baseline/fsf/gmp/manifests/src amiga/fsf/gmp/manifests/src
  3015. --- baseline/fsf/gmp/manifests/src    Wed Dec 31 17:00:00 1969
  3016. +++ amiga/fsf/gmp/manifests/src    Sat Sep 28 00:00:00 1996
  3017. @@ -0,0 +1,459 @@
  3018. +fsf/gmp/COPYING.LIB
  3019. +fsf/gmp/ChangeLog
  3020. +fsf/gmp/INSTALL
  3021. +fsf/gmp/Makefile.in
  3022. +fsf/gmp/NEWS
  3023. +fsf/gmp/PROJECTS
  3024. +fsf/gmp/Product-Info
  3025. +fsf/gmp/README
  3026. +fsf/gmp/SPEED
  3027. +fsf/gmp/config.guess
  3028. +fsf/gmp/config.sub
  3029. +fsf/gmp/config/mt-linux
  3030. +fsf/gmp/config/mt-m88110
  3031. +fsf/gmp/config/mt-sprc8-gcc
  3032. +fsf/gmp/config/mt-supspc-gcc
  3033. +fsf/gmp/configure
  3034. +fsf/gmp/configure.in
  3035. +fsf/gmp/cre-mparam.c
  3036. +fsf/gmp/demos/factorize.c
  3037. +fsf/gmp/extract-double.c
  3038. +fsf/gmp/gmp-impl.h
  3039. +fsf/gmp/gmp.h
  3040. +fsf/gmp/gmp.texi
  3041. +fsf/gmp/insert-double.c
  3042. +fsf/gmp/install.sh
  3043. +fsf/gmp/longlong.h
  3044. +fsf/gmp/make.bat
  3045. +fsf/gmp/manifests/bin
  3046. +fsf/gmp/manifests/src
  3047. +fsf/gmp/memory.c
  3048. +fsf/gmp/mkinstalldirs
  3049. +fsf/gmp/move-if-change
  3050. +fsf/gmp/mp.h
  3051. +fsf/gmp/mp_bpl.c
  3052. +fsf/gmp/mp_clz_tab.c
  3053. +fsf/gmp/mp_set_fns.c
  3054. +fsf/gmp/mpbsd/Makefile.in
  3055. +fsf/gmp/mpbsd/configure.in
  3056. +fsf/gmp/mpbsd/itom.c
  3057. +fsf/gmp/mpbsd/mdiv.c
  3058. +fsf/gmp/mpbsd/mfree.c
  3059. +fsf/gmp/mpbsd/min.c
  3060. +fsf/gmp/mpbsd/mout.c
  3061. +fsf/gmp/mpbsd/move.c
  3062. +fsf/gmp/mpbsd/mtox.c
  3063. +fsf/gmp/mpbsd/realloc.c
  3064. +fsf/gmp/mpbsd/sdiv.c
  3065. +fsf/gmp/mpbsd/xtom.c
  3066. +fsf/gmp/mpf/Makefile.in
  3067. +fsf/gmp/mpf/abs.c
  3068. +fsf/gmp/mpf/add.c
  3069. +fsf/gmp/mpf/add_ui.c
  3070. +fsf/gmp/mpf/clear.c
  3071. +fsf/gmp/mpf/cmp.c
  3072. +fsf/gmp/mpf/cmp_si.c
  3073. +fsf/gmp/mpf/cmp_ui.c
  3074. +fsf/gmp/mpf/configure.in
  3075. +fsf/gmp/mpf/div.c
  3076. +fsf/gmp/mpf/div_2exp.c
  3077. +fsf/gmp/mpf/div_ui.c
  3078. +fsf/gmp/mpf/dump.c
  3079. +fsf/gmp/mpf/eq.c
  3080. +fsf/gmp/mpf/get_d.c
  3081. +fsf/gmp/mpf/get_prc.c
  3082. +fsf/gmp/mpf/get_str.c
  3083. +fsf/gmp/mpf/init.c
  3084. +fsf/gmp/mpf/init2.c
  3085. +fsf/gmp/mpf/inp_str.c
  3086. +fsf/gmp/mpf/iset.c
  3087. +fsf/gmp/mpf/iset_d.c
  3088. +fsf/gmp/mpf/iset_si.c
  3089. +fsf/gmp/mpf/iset_str.c
  3090. +fsf/gmp/mpf/iset_ui.c
  3091. +fsf/gmp/mpf/mul.c
  3092. +fsf/gmp/mpf/mul_2exp.c
  3093. +fsf/gmp/mpf/mul_ui.c
  3094. +fsf/gmp/mpf/neg.c
  3095. +fsf/gmp/mpf/out_str.c
  3096. +fsf/gmp/mpf/random2.c
  3097. +fsf/gmp/mpf/reldiff.c
  3098. +fsf/gmp/mpf/set.c
  3099. +fsf/gmp/mpf/set_d.c
  3100. +fsf/gmp/mpf/set_dfl_prec.c
  3101. +fsf/gmp/mpf/set_prc.c
  3102. +fsf/gmp/mpf/set_prc_raw.c
  3103. +fsf/gmp/mpf/set_q.c
  3104. +fsf/gmp/mpf/set_si.c
  3105. +fsf/gmp/mpf/set_str.c
  3106. +fsf/gmp/mpf/set_ui.c
  3107. +fsf/gmp/mpf/set_z.c
  3108. +fsf/gmp/mpf/size.c
  3109. +fsf/gmp/mpf/sqrt.c
  3110. +fsf/gmp/mpf/sqrt_ui.c
  3111. +fsf/gmp/mpf/sub.c
  3112. +fsf/gmp/mpf/sub_ui.c
  3113. +fsf/gmp/mpf/tests/Makefile.in
  3114. +fsf/gmp/mpf/tests/configure.in
  3115. +fsf/gmp/mpf/tests/ref.c
  3116. +fsf/gmp/mpf/tests/reuse.c
  3117. +fsf/gmp/mpf/tests/t-add.c
  3118. +fsf/gmp/mpf/tests/t-conv.c
  3119. +fsf/gmp/mpf/tests/t-dm2exp.c
  3120. +fsf/gmp/mpf/tests/t-muldiv.c
  3121. +fsf/gmp/mpf/tests/t-sqrt.c
  3122. +fsf/gmp/mpf/tests/t-sub.c
  3123. +fsf/gmp/mpf/ui_div.c
  3124. +fsf/gmp/mpf/ui_sub.c
  3125. +fsf/gmp/mpn/Makefile.in
  3126. +fsf/gmp/mpn/README
  3127. +fsf/gmp/mpn/a29k/add_n.s
  3128. +fsf/gmp/mpn/a29k/addmul_1.s
  3129. +fsf/gmp/mpn/a29k/lshift.s
  3130. +fsf/gmp/mpn/a29k/mul_1.s
  3131. +fsf/gmp/mpn/a29k/rshift.s
  3132. +fsf/gmp/mpn/a29k/sub_n.s
  3133. +fsf/gmp/mpn/a29k/submul_1.s
  3134. +fsf/gmp/mpn/alpha/README
  3135. +fsf/gmp/mpn/alpha/add_n.s
  3136. +fsf/gmp/mpn/alpha/addmul_1.s
  3137. +fsf/gmp/mpn/alpha/ev5/add_n.s
  3138. +fsf/gmp/mpn/alpha/ev5/lshift.s
  3139. +fsf/gmp/mpn/alpha/ev5/rshift.s
  3140. +fsf/gmp/mpn/alpha/ev5/sub_n.s
  3141. +fsf/gmp/mpn/alpha/gmp-mparam.h
  3142. +fsf/gmp/mpn/alpha/lshift.s
  3143. +fsf/gmp/mpn/alpha/mul_1.s
  3144. +fsf/gmp/mpn/alpha/rshift.s
  3145. +fsf/gmp/mpn/alpha/sub_n.s
  3146. +fsf/gmp/mpn/alpha/submul_1.s
  3147. +fsf/gmp/mpn/alpha/udiv_qrnnd.S
  3148. +fsf/gmp/mpn/bsd.h
  3149. +fsf/gmp/mpn/clipper/add_n.s
  3150. +fsf/gmp/mpn/clipper/mul_1.s
  3151. +fsf/gmp/mpn/clipper/sub_n.s
  3152. +fsf/gmp/mpn/config/t-oldgas
  3153. +fsf/gmp/mpn/config/t-ppc-aix
  3154. +fsf/gmp/mpn/config/t-pwr-aix
  3155. +fsf/gmp/mpn/configure.in
  3156. +fsf/gmp/mpn/cray/gmp-mparam.h
  3157. +fsf/gmp/mpn/generic/add_n.c
  3158. +fsf/gmp/mpn/generic/addmul_1.c
  3159. +fsf/gmp/mpn/generic/bdivmod.c
  3160. +fsf/gmp/mpn/generic/cmp.c
  3161. +fsf/gmp/mpn/generic/divmod_1.c
  3162. +fsf/gmp/mpn/generic/divrem.c
  3163. +fsf/gmp/mpn/generic/divrem_1.c
  3164. +fsf/gmp/mpn/generic/dump.c
  3165. +fsf/gmp/mpn/generic/gcd.c
  3166. +fsf/gmp/mpn/generic/gcd_1.c
  3167. +fsf/gmp/mpn/generic/gcdext.c
  3168. +fsf/gmp/mpn/generic/get_str.c
  3169. +fsf/gmp/mpn/generic/gmp-mparam.h
  3170. +fsf/gmp/mpn/generic/hamdist.c
  3171. +fsf/gmp/mpn/generic/inlines.c
  3172. +fsf/gmp/mpn/generic/lshift.c
  3173. +fsf/gmp/mpn/generic/mod_1.c
  3174. +fsf/gmp/mpn/generic/mul.c
  3175. +fsf/gmp/mpn/generic/mul_1.c
  3176. +fsf/gmp/mpn/generic/mul_n.c
  3177. +fsf/gmp/mpn/generic/perfsqr.c
  3178. +fsf/gmp/mpn/generic/popcount.c
  3179. +fsf/gmp/mpn/generic/pre_mod_1.c
  3180. +fsf/gmp/mpn/generic/random2.c
  3181. +fsf/gmp/mpn/generic/rshift.c
  3182. +fsf/gmp/mpn/generic/scan0.c
  3183. +fsf/gmp/mpn/generic/scan1.c
  3184. +fsf/gmp/mpn/generic/set_str.c
  3185. +fsf/gmp/mpn/generic/sqrtrem.c
  3186. +fsf/gmp/mpn/generic/sub_n.c
  3187. +fsf/gmp/mpn/generic/submul_1.c
  3188. +fsf/gmp/mpn/generic/udiv_w_sdiv.c
  3189. +fsf/gmp/mpn/hppa/README
  3190. +fsf/gmp/mpn/hppa/add_n.s
  3191. +fsf/gmp/mpn/hppa/hppa1_1/addmul_1.s
  3192. +fsf/gmp/mpn/hppa/hppa1_1/mul_1.s
  3193. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/add_n.s
  3194. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/addmul_1.S
  3195. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/lshift.s
  3196. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/rshift.s
  3197. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/sub_n.s
  3198. +fsf/gmp/mpn/hppa/hppa1_1/pa7100/submul_1.S
  3199. +fsf/gmp/mpn/hppa/hppa1_1/submul_1.s
  3200. +fsf/gmp/mpn/hppa/hppa1_1/udiv_qrnnd.s
  3201. +fsf/gmp/mpn/hppa/lshift.s
  3202. +fsf/gmp/mpn/hppa/rshift.s
  3203. +fsf/gmp/mpn/hppa/sub_n.s
  3204. +fsf/gmp/mpn/hppa/udiv_qrnnd.s
  3205. +fsf/gmp/mpn/i960/README
  3206. +fsf/gmp/mpn/i960/add_n.s
  3207. +fsf/gmp/mpn/i960/addmul_1.s
  3208. +fsf/gmp/mpn/i960/mul_1.s
  3209. +fsf/gmp/mpn/i960/sub_n.s
  3210. +fsf/gmp/mpn/m68k/add_n.S
  3211. +fsf/gmp/mpn/m68k/lshift.S
  3212. +fsf/gmp/mpn/m68k/mc68020/addmul_1.S
  3213. +fsf/gmp/mpn/m68k/mc68020/mul_1.S
  3214. +fsf/gmp/mpn/m68k/mc68020/submul_1.S
  3215. +fsf/gmp/mpn/m68k/rshift.S
  3216. +fsf/gmp/mpn/m68k/sub_n.S
  3217. +fsf/gmp/mpn/m68k/syntax.h
  3218. +fsf/gmp/mpn/m88k/add_n.s
  3219. +fsf/gmp/mpn/m88k/mc88110/add_n.S
  3220. +fsf/gmp/mpn/m88k/mc88110/addmul_1.s
  3221. +fsf/gmp/mpn/m88k/mc88110/mul_1.s
  3222. +fsf/gmp/mpn/m88k/mc88110/sub_n.S
  3223. +fsf/gmp/mpn/m88k/mul_1.s
  3224. +fsf/gmp/mpn/m88k/sub_n.s
  3225. +fsf/gmp/mpn/mips2/add_n.s
  3226. +fsf/gmp/mpn/mips2/addmul_1.s
  3227. +fsf/gmp/mpn/mips2/lshift.s
  3228. +fsf/gmp/mpn/mips2/mul_1.s
  3229. +fsf/gmp/mpn/mips2/rshift.s
  3230. +fsf/gmp/mpn/mips2/sub_n.s
  3231. +fsf/gmp/mpn/mips2/submul_1.s
  3232. +fsf/gmp/mpn/mips3/README
  3233. +fsf/gmp/mpn/mips3/add_n.s
  3234. +fsf/gmp/mpn/mips3/addmul_1.s
  3235. +fsf/gmp/mpn/mips3/gmp-mparam.h
  3236. +fsf/gmp/mpn/mips3/lshift.s
  3237. +fsf/gmp/mpn/mips3/mul_1.s
  3238. +fsf/gmp/mpn/mips3/rshift.s
  3239. +fsf/gmp/mpn/mips3/sub_n.s
  3240. +fsf/gmp/mpn/mips3/submul_1.s
  3241. +fsf/gmp/mpn/mp_bases.c
  3242. +fsf/gmp/mpn/msdos/asm-syntax.h
  3243. +fsf/gmp/mpn/ns32k/add_n.s
  3244. +fsf/gmp/mpn/ns32k/addmul_1.s
  3245. +fsf/gmp/mpn/ns32k/mul_1.s
  3246. +fsf/gmp/mpn/ns32k/sub_n.s
  3247. +fsf/gmp/mpn/ns32k/submul_1.s
  3248. +fsf/gmp/mpn/power/add_n.s
  3249. +fsf/gmp/mpn/power/addmul_1.s
  3250. +fsf/gmp/mpn/power/lshift.s
  3251. +fsf/gmp/mpn/power/mul_1.s
  3252. +fsf/gmp/mpn/power/rshift.s
  3253. +fsf/gmp/mpn/power/sub_n.s
  3254. +fsf/gmp/mpn/power/submul_1.s
  3255. +fsf/gmp/mpn/powerpc32/add_n.s
  3256. +fsf/gmp/mpn/powerpc32/addmul_1.s
  3257. +fsf/gmp/mpn/powerpc32/lshift.s
  3258. +fsf/gmp/mpn/powerpc32/mul_1.s
  3259. +fsf/gmp/mpn/powerpc32/rshift.s
  3260. +fsf/gmp/mpn/powerpc32/sub_n.s
  3261. +fsf/gmp/mpn/powerpc32/submul_1.s
  3262. +fsf/gmp/mpn/powerpc64/gmp-mparam.h
  3263. +fsf/gmp/mpn/pyr/add_n.s
  3264. +fsf/gmp/mpn/pyr/addmul_1.s
  3265. +fsf/gmp/mpn/pyr/mul_1.s
  3266. +fsf/gmp/mpn/pyr/sub_n.s
  3267. +fsf/gmp/mpn/sh/add_n.s
  3268. +fsf/gmp/mpn/sh/sh2/addmul_1.s
  3269. +fsf/gmp/mpn/sh/sh2/mul_1.s
  3270. +fsf/gmp/mpn/sh/sh2/submul_1.s
  3271. +fsf/gmp/mpn/sh/sub_n.s
  3272. +fsf/gmp/mpn/sparc32/README
  3273. +fsf/gmp/mpn/sparc32/add_n.S
  3274. +fsf/gmp/mpn/sparc32/addmul_1.S
  3275. +fsf/gmp/mpn/sparc32/lshift.S
  3276. +fsf/gmp/mpn/sparc32/mul_1.S
  3277. +fsf/gmp/mpn/sparc32/rshift.S
  3278. +fsf/gmp/mpn/sparc32/sub_n.S
  3279. +fsf/gmp/mpn/sparc32/submul_1.S
  3280. +fsf/gmp/mpn/sparc32/udiv_fp.S
  3281. +fsf/gmp/mpn/sparc32/udiv_nfp.S
  3282. +fsf/gmp/mpn/sparc32/v8/addmul_1.S
  3283. +fsf/gmp/mpn/sparc32/v8/mul_1.S
  3284. +fsf/gmp/mpn/sparc32/v8/submul_1.S
  3285. +fsf/gmp/mpn/sparc32/v8/supersparc/udiv.S
  3286. +fsf/gmp/mpn/sparc64/add_n.s
  3287. +fsf/gmp/mpn/sparc64/addmul_1.s
  3288. +fsf/gmp/mpn/sparc64/gmp-mparam.h
  3289. +fsf/gmp/mpn/sparc64/lshift.s
  3290. +fsf/gmp/mpn/sparc64/mul_1.s
  3291. +fsf/gmp/mpn/sparc64/rshift.s
  3292. +fsf/gmp/mpn/sparc64/sub_n.s
  3293. +fsf/gmp/mpn/sparc64/submul_1.s
  3294. +fsf/gmp/mpn/sysv.h
  3295. +fsf/gmp/mpn/tests/add_n.c
  3296. +fsf/gmp/mpn/tests/addmul_1.c
  3297. +fsf/gmp/mpn/tests/divmod_1.c
  3298. +fsf/gmp/mpn/tests/divrem.c
  3299. +fsf/gmp/mpn/tests/lshift.c
  3300. +fsf/gmp/mpn/tests/mul_1.c
  3301. +fsf/gmp/mpn/tests/rshift.c
  3302. +fsf/gmp/mpn/tests/sub_n.c
  3303. +fsf/gmp/mpn/tests/submul_1.c
  3304. +fsf/gmp/mpn/tests/tst-addsub.c
  3305. +fsf/gmp/mpn/vax/add_n.s
  3306. +fsf/gmp/mpn/vax/addmul_1.s
  3307. +fsf/gmp/mpn/vax/mul_1.s
  3308. +fsf/gmp/mpn/vax/sub_n.s
  3309. +fsf/gmp/mpn/vax/submul_1.s
  3310. +fsf/gmp/mpn/x86/add_n.S
  3311. +fsf/gmp/mpn/x86/addmul_1.S
  3312. +fsf/gmp/mpn/x86/lshift.S
  3313. +fsf/gmp/mpn/x86/mul_1.S
  3314. +fsf/gmp/mpn/x86/pentium/README
  3315. +fsf/gmp/mpn/x86/pentium/add_n.S
  3316. +fsf/gmp/mpn/x86/pentium/addmul_1.S
  3317. +fsf/gmp/mpn/x86/pentium/lshift.S
  3318. +fsf/gmp/mpn/x86/pentium/mul_1.S
  3319. +fsf/gmp/mpn/x86/pentium/rshift.S
  3320. +fsf/gmp/mpn/x86/pentium/sub_n.S
  3321. +fsf/gmp/mpn/x86/pentium/submul_1.S
  3322. +fsf/gmp/mpn/x86/rshift.S
  3323. +fsf/gmp/mpn/x86/sub_n.S
  3324. +fsf/gmp/mpn/x86/submul_1.S
  3325. +fsf/gmp/mpn/x86/syntax.h
  3326. +fsf/gmp/mpn/z8000/add_n.s
  3327. +fsf/gmp/mpn/z8000/gmp-mparam.h
  3328. +fsf/gmp/mpn/z8000/mul_1.s
  3329. +fsf/gmp/mpn/z8000/sub_n.s
  3330. +fsf/gmp/mpn/z8000x/add_n.s
  3331. +fsf/gmp/mpn/z8000x/sub_n.s
  3332. +fsf/gmp/mpq/Makefile.in
  3333. +fsf/gmp/mpq/add.c
  3334. +fsf/gmp/mpq/canonicalize.c
  3335. +fsf/gmp/mpq/clear.c
  3336. +fsf/gmp/mpq/cmp.c
  3337. +fsf/gmp/mpq/cmp_ui.c
  3338. +fsf/gmp/mpq/configure.in
  3339. +fsf/gmp/mpq/div.c
  3340. +fsf/gmp/mpq/equal.c
  3341. +fsf/gmp/mpq/get_d.c
  3342. +fsf/gmp/mpq/get_den.c
  3343. +fsf/gmp/mpq/get_num.c
  3344. +fsf/gmp/mpq/init.c
  3345. +fsf/gmp/mpq/inv.c
  3346. +fsf/gmp/mpq/mul.c
  3347. +fsf/gmp/mpq/neg.c
  3348. +fsf/gmp/mpq/set.c
  3349. +fsf/gmp/mpq/set_den.c
  3350. +fsf/gmp/mpq/set_num.c
  3351. +fsf/gmp/mpq/set_si.c
  3352. +fsf/gmp/mpq/set_ui.c
  3353. +fsf/gmp/mpq/set_z.c
  3354. +fsf/gmp/mpq/sub.c
  3355. +fsf/gmp/mpq/tests/Makefile.in
  3356. +fsf/gmp/mpq/tests/configure.in
  3357. +fsf/gmp/mpq/tests/t-cmp.c
  3358. +fsf/gmp/mpq/tests/t-cmp_ui.c
  3359. +fsf/gmp/mpq/tests/t-get_d.c
  3360. +fsf/gmp/mpz/Makefile.in
  3361. +fsf/gmp/mpz/abs.c
  3362. +fsf/gmp/mpz/add.c
  3363. +fsf/gmp/mpz/add_ui.c
  3364. +fsf/gmp/mpz/and.c
  3365. +fsf/gmp/mpz/array_init.c
  3366. +fsf/gmp/mpz/cdiv_q.c
  3367. +fsf/gmp/mpz/cdiv_q_ui.c
  3368. +fsf/gmp/mpz/cdiv_qr.c
  3369. +fsf/gmp/mpz/cdiv_qr_ui.c
  3370. +fsf/gmp/mpz/cdiv_r.c
  3371. +fsf/gmp/mpz/cdiv_r_ui.c
  3372. +fsf/gmp/mpz/cdiv_ui.c
  3373. +fsf/gmp/mpz/clear.c
  3374. +fsf/gmp/mpz/clrbit.c
  3375. +fsf/gmp/mpz/cmp.c
  3376. +fsf/gmp/mpz/cmp_si.c
  3377. +fsf/gmp/mpz/cmp_ui.c
  3378. +fsf/gmp/mpz/com.c
  3379. +fsf/gmp/mpz/configure.in
  3380. +fsf/gmp/mpz/divexact.c
  3381. +fsf/gmp/mpz/dmincl.c
  3382. +fsf/gmp/mpz/fac_ui.c
  3383. +fsf/gmp/mpz/fdiv_q.c
  3384. +fsf/gmp/mpz/fdiv_q_2exp.c
  3385. +fsf/gmp/mpz/fdiv_q_ui.c
  3386. +fsf/gmp/mpz/fdiv_qr.c
  3387. +fsf/gmp/mpz/fdiv_qr_ui.c
  3388. +fsf/gmp/mpz/fdiv_r.c
  3389. +fsf/gmp/mpz/fdiv_r_2exp.c
  3390. +fsf/gmp/mpz/fdiv_r_ui.c
  3391. +fsf/gmp/mpz/fdiv_ui.c
  3392. +fsf/gmp/mpz/gcd.c
  3393. +fsf/gmp/mpz/gcd_ui.c
  3394. +fsf/gmp/mpz/gcdext.c
  3395. +fsf/gmp/mpz/get_d.c
  3396. +fsf/gmp/mpz/get_si.c
  3397. +fsf/gmp/mpz/get_str.c
  3398. +fsf/gmp/mpz/get_ui.c
  3399. +fsf/gmp/mpz/getlimbn.c
  3400. +fsf/gmp/mpz/hamdist.c
  3401. +fsf/gmp/mpz/init.c
  3402. +fsf/gmp/mpz/inp_raw.c
  3403. +fsf/gmp/mpz/inp_str.c
  3404. +fsf/gmp/mpz/invert.c
  3405. +fsf/gmp/mpz/ior.c
  3406. +fsf/gmp/mpz/iset.c
  3407. +fsf/gmp/mpz/iset_d.c
  3408. +fsf/gmp/mpz/iset_si.c
  3409. +fsf/gmp/mpz/iset_str.c
  3410. +fsf/gmp/mpz/iset_ui.c
  3411. +fsf/gmp/mpz/jacobi.c
  3412. +fsf/gmp/mpz/legendre.c
  3413. +fsf/gmp/mpz/mod.c
  3414. +fsf/gmp/mpz/mul.c
  3415. +fsf/gmp/mpz/mul_2exp.c
  3416. +fsf/gmp/mpz/mul_ui.c
  3417. +fsf/gmp/mpz/neg.c
  3418. +fsf/gmp/mpz/out_raw.c
  3419. +fsf/gmp/mpz/out_str.c
  3420. +fsf/gmp/mpz/perfsqr.c
  3421. +fsf/gmp/mpz/popcount.c
  3422. +fsf/gmp/mpz/pow_ui.c
  3423. +fsf/gmp/mpz/powm.c
  3424. +fsf/gmp/mpz/powm_ui.c
  3425. +fsf/gmp/mpz/pprime_p.c
  3426. +fsf/gmp/mpz/random.c
  3427. +fsf/gmp/mpz/random2.c
  3428. +fsf/gmp/mpz/realloc.c
  3429. +fsf/gmp/mpz/scan0.c
  3430. +fsf/gmp/mpz/scan1.c
  3431. +fsf/gmp/mpz/set.c
  3432. +fsf/gmp/mpz/set_d.c
  3433. +fsf/gmp/mpz/set_f.c
  3434. +fsf/gmp/mpz/set_q.c
  3435. +fsf/gmp/mpz/set_si.c
  3436. +fsf/gmp/mpz/set_str.c
  3437. +fsf/gmp/mpz/set_ui.c
  3438. +fsf/gmp/mpz/setbit.c
  3439. +fsf/gmp/mpz/size.c
  3440. +fsf/gmp/mpz/sizeinbase.c
  3441. +fsf/gmp/mpz/sqrt.c
  3442. +fsf/gmp/mpz/sqrtrem.c
  3443. +fsf/gmp/mpz/sub.c
  3444. +fsf/gmp/mpz/sub_ui.c
  3445. +fsf/gmp/mpz/tdiv_q.c
  3446. +fsf/gmp/mpz/tdiv_q_2exp.c
  3447. +fsf/gmp/mpz/tdiv_q_ui.c
  3448. +fsf/gmp/mpz/tdiv_qr.c
  3449. +fsf/gmp/mpz/tdiv_qr_ui.c
  3450. +fsf/gmp/mpz/tdiv_r.c
  3451. +fsf/gmp/mpz/tdiv_r_2exp.c
  3452. +fsf/gmp/mpz/tdiv_r_ui.c
  3453. +fsf/gmp/mpz/tests/Makefile.in
  3454. +fsf/gmp/mpz/tests/configure.in
  3455. +fsf/gmp/mpz/tests/convert.c
  3456. +fsf/gmp/mpz/tests/dive.c
  3457. +fsf/gmp/mpz/tests/io-binary.c
  3458. +fsf/gmp/mpz/tests/io.c
  3459. +fsf/gmp/mpz/tests/logic.c
  3460. +fsf/gmp/mpz/tests/reuse.c
  3461. +fsf/gmp/mpz/tests/t-fdiv.c
  3462. +fsf/gmp/mpz/tests/t-fdiv_ui.c
  3463. +fsf/gmp/mpz/tests/t-gcd.c
  3464. +fsf/gmp/mpz/tests/t-gcd2.c
  3465. +fsf/gmp/mpz/tests/t-mul.c
  3466. +fsf/gmp/mpz/tests/t-powm.c
  3467. +fsf/gmp/mpz/tests/t-powm_ui.c
  3468. +fsf/gmp/mpz/tests/t-sqrtrem.c
  3469. +fsf/gmp/mpz/tests/t-tdiv.c
  3470. +fsf/gmp/mpz/tests/t-tdiv_ui.c
  3471. +fsf/gmp/mpz/ui_pow_ui.c
  3472. +fsf/gmp/stack-alloc.c
  3473. +fsf/gmp/stack-alloc.h
  3474. +fsf/gmp/texinfo.tex
  3475. +fsf/gmp/urandom.h
  3476. +fsf/gmp/version.c
  3477. diff -rup --new-file baseline/fsf/gmp/mpn/configure.in amiga/fsf/gmp/mpn/configure.in
  3478. --- baseline/fsf/gmp/mpn/configure.in    Mon Jun  3 22:52:01 1996
  3479. +++ amiga/fsf/gmp/mpn/configure.in    Sat Sep 28 00:00:00 1996
  3480. @@ -60,6 +60,12 @@ case "${target}" in
  3481.  
  3482.  # Motorola 68k configurations.  Let m68k mean 68020-68040.
  3483.  # mc68000 or mc68060 configurations need to be specified explicitly
  3484. +  # For AmigaOS, we want to build for the lowest common denominator
  3485. +  # by default.
  3486. +  m68k*-*-amigaos)
  3487. +        echo '#define MIT_SYNTAX' >asm-syntax.h
  3488. +    echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
  3489. +    path="m68k/mc68000" ;;
  3490.    m680[234]0*-*-linuxaout* | m68k*-*-linuxaout*)
  3491.          echo '#define MIT_SYNTAX' >asm-syntax.h
  3492.      echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
  3493.