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) 2014 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 
45 #define flt32 int
46 
51 int flt32_get_sign (flt32 x);
52 
57 int flt32_get_exp (flt32 x);
58 
63 int flt32_get_val (flt32 x);
64 
72 void flt32_get_all(flt32 x, int* sign, int*exp, int* val);
73 
79 int flt32_left_most_1 (int value);
80 
88 
96 
103 flt32 flt32_add (flt32 x, flt32 y);
104 
111 flt32 flt32_sub (flt32 x, flt32 y);
112 
113 #endif