2
* Simple test driver for MPI library
4
* Test 2: Basic addition and subtraction test
6
* The contents of this file are subject to the Mozilla Public
7
* License Version 1.1 (the "License"); you may not use this file
8
* except in compliance with the License. You may obtain a copy of
9
* the License at http://www.mozilla.org/MPL/
11
* Software distributed under the License is distributed on an "AS
12
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13
* implied. See the License for the specific language governing
14
* rights and limitations under the License.
16
* The Original Code is the MPI Arbitrary Precision Integer Arithmetic
19
* The Initial Developer of the Original Code is Michael J. Fromberger.
20
* Portions created by Michael J. Fromberger are
21
* Copyright (C) 1998, 1999, 2000 Michael J. Fromberger.
22
* All Rights Reserved.
26
* Alternatively, the contents of this file may be used under the
27
* terms of the GNU General Public License Version 2 or later (the
28
* "GPL"), in which case the provisions of the GPL are applicable
29
* instead of those above. If you wish to allow use of your
30
* version of this file only under the terms of the GPL and not to
31
* allow others to use your version of this file under the MPL,
32
* indicate your decision by deleting the provisions above and
33
* replace them with the notice and other provisions required by
34
* the GPL. If you do not delete the provisions above, a recipient
35
* may use your version of this file under either the MPL or the GPL.
37
* $Id: mptest-2.c,v 1.1 2000/07/14 00:44:42 nelsonb%netscape.com Exp $
48
int main(int argc, char *argv[])
53
fprintf(stderr, "Usage: %s <a> <b>\n", argv[0]);
57
printf("Test 2: Basic addition and subtraction\n\n");
62
mp_read_radix(&a, argv[1], 10);
63
mp_read_radix(&b, argv[2], 10);
64
printf("a = "); mp_print(&a, stdout); fputc('\n', stdout);
65
printf("b = "); mp_print(&b, stdout); fputc('\n', stdout);
68
printf("c = a + b\n");
71
printf("c = "); mp_print(&c, stdout); fputc('\n', stdout);
73
printf("c = a - b\n");
76
printf("c = "); mp_print(&c, stdout); fputc('\n', stdout);