My Project
numconv.h
Go to the documentation of this file.
1 #ifndef __NUMCONV_H__
2 #define __NUMCONV_H__
3 
4 /*
5  * numconv.h - simple functions to convert between internal/external
6  * representations of numbers
7  *
8  * "Copyright (c) 2013-16 by Fritz Sieker."
9  *
10  * Permission to use, copy, modify, and distribute this software and its
11  * documentation for any purpose, without fee, and without written
12  * agreement is hereby granted, provided that the above copyright notice
13  * and the following two paragraphs appear in all copies of this software.
14  *
15  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
16  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
17  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
18  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19  *
20  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
23  * BASIS, AND THE AUTHOR NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
24  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
25  */
26 
44 char int2char (int radix, int value);
45 
57 int char2int (int radix, char digit);
58 
74 void divRem (int numerator, int divisor, int* quotient, int* remainder);
75 
105 int ascii2int (int radix, int valueOfPrefix);
106 
126 void int2ascii (int radix, int value);
127 
156 double frac2double (int radix);
157 
158 #endif
char int2char(int radix, int value)
Definition: numconv.c:8
int char2int(int radix, char digit)
Definition: numconv.c:15
void divRem(int numerator, int divisor, int *quotient, int *remainder)
Definition: numconv.c:22
void int2ascii(int radix, int value)
Definition: numconv.c:35
double frac2double(int radix)
Definition: numconv.c:41
int ascii2int(int radix, int valueOfPrefix)
Definition: numconv.c:28