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 
42 char int2char (int radix, int digit);
43 
50 int char2int (int radix, char digit);
51 
63 void divRem (int numerator, int divisor, int* quotient, int* remainder);
64 
70 int ascii2int (int radix, const char *str);
71 
81 void int2ascii (int radix, int value);
82 
89 double ascii2double (int radix, const char *str);
90 
91 #endif
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
int ascii2int(int radix, const char *str)
Definition: numconv.c:28
double ascii2double(int radix, const char *str)
Definition: numconv.c:41
char int2char(int radix, int digit)
Definition: numconv.c:8