summaryrefslogtreecommitdiff
path: root/h/number.h
diff options
context:
space:
mode:
Diffstat (limited to 'h/number.h')
-rw-r--r--h/number.h76
1 files changed, 33 insertions, 43 deletions
diff --git a/h/number.h b/h/number.h
index 8d78120..abf6332 100644
--- a/h/number.h
+++ b/h/number.h
@@ -1,10 +1,10 @@
/* number.h: Arbitrary precision numbers header file. */
/*
- Copyright (C) 1991, 1992, 1993, 1994, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1993, 1994, 1997, 2000, 2012-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License , or
+ the Free Software Foundation; either version 3 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -16,8 +16,8 @@
along with this program; see the file COPYING. If not, write to:
The Free Software Foundation, Inc.
- 59 Temple Place, Suite 330
- Boston, MA 02111-1307 USA.
+ 51 Franklin Street, Fifth Floor
+ Boston, MA 02110-1301 USA
You may contact the author by:
@@ -77,7 +77,7 @@ typedef struct bc_struct
#endif
#ifndef LONG_MAX
-#define LONG_MAX 0x7ffffff
+#define LONG_MAX 0x7fffffff
#endif
@@ -89,65 +89,55 @@ extern bc_num _two_;
/* Function Prototypes */
-/* Define the _PROTOTYPE macro if it is needed. */
+void bc_init_numbers (void);
-#ifndef _PROTOTYPE
-#ifdef __STDC__
-#define _PROTOTYPE(func, args) func args
-#else
-#define _PROTOTYPE(func, args) func()
-#endif
-#endif
-
-_PROTOTYPE(void bc_init_numbers, (void));
-
-_PROTOTYPE(bc_num bc_new_num, (int length, int scale));
+bc_num bc_new_num (int length, int scale);
-_PROTOTYPE(void bc_free_num, (bc_num *num));
+void bc_free_num (bc_num *num);
-_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
+bc_num bc_copy_num (bc_num num);
-_PROTOTYPE(void bc_init_num, (bc_num *num));
+void bc_init_num (bc_num *num);
-_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
+void bc_str2num (bc_num *num, char *str, int scale);
-_PROTOTYPE(char *bc_num2str, (bc_num num));
+char *bc_num2str (bc_num num);
-_PROTOTYPE(void bc_int2num, (bc_num *num, int val));
+void bc_int2num (bc_num *num, int val);
-_PROTOTYPE(long bc_num2long, (bc_num num));
+long bc_num2long (bc_num num);
-_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
+int bc_compare (bc_num n1, bc_num n2);
-_PROTOTYPE(char bc_is_zero, (bc_num num));
+char bc_is_zero (bc_num num);
-_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
+char bc_is_near_zero (bc_num num, int scale);
-_PROTOTYPE(char bc_is_neg, (bc_num num));
+char bc_is_neg (bc_num num);
-_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
+void bc_add (bc_num n1, bc_num n2, bc_num *result, int scale_min);
-_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
+void bc_sub (bc_num n1, bc_num n2, bc_num *result, int scale_min);
-_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
+void bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale);
-_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
+int bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale);
-_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
- int scale));
+int bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale);
-_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
- bc_num *rem, int scale));
+int bc_divmod (bc_num num1, bc_num num2, bc_num *quot,
+ bc_num *rem, int scale);
-_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
- bc_num *result, int scale));
+int bc_raisemod (bc_num base, bc_num expo, bc_num mod,
+ bc_num *result, int scale);
-_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
- int scale));
+void bc_raise (bc_num num1, bc_num num2, bc_num *result,
+ int scale);
-_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
+int bc_sqrt (bc_num *num, int scale);
-_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
- int leading_zero));
+void bc_out_num (bc_num num, int o_base, void (* out_char)(int),
+ int leading_zero);
+void bc_out_long (long val, int size, int space, void (*out_char)(int));
#endif