flt32.h
Go to the documentation of this file.
1 #ifndef __FLT32_H__
2 #define __FLT32_H__
3 
4 /*
5  * flt32.h - header for simple floating point functions.
6  *
7  * "Copyright (c) 2013 by Fritz Sieker."
8  *
9  * Permission to use, copy, modify, and distribute this software and its
10  * documentation for any purpose, without fee, and without written
11  * agreement is hereby granted, provided that the above copyright notice
12  * and the following two paragraphs appear in all copies of this software.
13  *
14  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
15  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
16  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR
17  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18  *
19  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
22  * BASIS, AND THE AUTHOR NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
23  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
24  */
25 
55 #define flt32 int
56 
61 int flt32_get_sign (flt32 x);
62 
67 int flt32_get_exp (flt32 x);
68 
73 int flt32_get_val (flt32 x);
74 
82 void flt32_get_all(flt32 x, int* sign, int*exp, int* val);
83 
89 int flt32_left_most_1 (int bits);
90 
97 
104 
111 flt32 flt32_add (flt32 x, flt32 y);
112 
119 flt32 flt32_sub (flt32 x, flt32 y);
120 
121 #endif
int flt32_left_most_1(int bits)
Definition: flt32.c:34
flt32 flt32_sub(flt32 x, flt32 y)
Definition: flt32.c:54
void flt32_get_all(flt32 x, int *sign, int *exp, int *val)
Definition: flt32.c:30
flt32 flt32_add(flt32 x, flt32 y)
Definition: flt32.c:49
#define flt32
Definition: flt32.h:55
flt32 flt32_negate(flt32 x)
Definition: flt32.c:44
int flt32_get_val(flt32 x)
Definition: flt32.c:25
int flt32_get_sign(flt32 x)
Definition: flt32.c:15
int flt32_get_exp(flt32 x)
Definition: flt32.c:20
flt32 flt32_abs(flt32 x)
Definition: flt32.c:39