Defines interface of convert.c functions (do not modify) More...
Go to the source code of this file.
Functions | |
unsigned int | toiFloat (const char *str, int width) |
float | fromiFloat (unsigned int x, int width) |
This file defines the interface to a C file convert.c that converts between float
and unsigned int
types. Thus, you do not need to declare ANY float
variables anywhere in your code. Note that the test driver testFloat.c
does not use any float
variables. While the declared variables are <ocde>int, and thus have 32 bits, the width parameter defines whether the lower 16 or all 32 bits hold the relevant information.
float fromiFloat | ( | unsigned int | x, |
int | width | ||
) |
Convert a iFloat_t
to a float
x | the unsigned int containing bits for a IEEE floating point value |
width | the "size" of the representation (32 or 16) |
float
unsigned int toiFloat | ( | const char * | str, |
int | width | ||
) |
Convert a string to a iFloat_t
str | the string to convert |
width | the "size" of the representation (32 or 16) |