Defines interface of flt32.c functions (do not modify) More...
Go to the source code of this file.
Macros | |
#define | flt32 int |
Functions | |
int | flt32_get_sign (flt32 x) |
int | flt32_get_exp (flt32 x) |
int | flt32_get_val (flt32 x) |
void | flt32_get_all (flt32 x, int *sign, int *exp, int *val) |
int | flt32_left_most_1 (int bits) |
flt32 | flt32_abs (flt32 x) |
flt32 | flt32_negate (flt32 x) |
flt32 | flt32_add (flt32 x, flt32 y) |
flt32 | flt32_sub (flt32 x, flt32 y) |
This file defines the interface to a C file flt32.c that you will complete. You will learn how to do floating point arithmatic without using any float
variables. Rather you will perform the operations by using the sign, exponent, and digit fields as defined in the IEEE floating Point Standard. You must use the function(s) of field.c which is provided to you as field.o
. That is, you will be submitting one file (flt32.c).
#define flt32 int |
Whenever flt32
" is used, the value is an integer in the IEEE floating point 32 bit standard.
Add two floating point values
x | an integer containing a IEEE floating point value |
y | an integer containing a IEEE floating point value |
void flt32_get_all | ( | flt32 | x, |
int * | sign, | ||
int * | exp, | ||
int * | val | ||
) |
Get the sign, exponent, and value in a single call. You will use the
x | the integer containing a IEEE floating point value |
sign | pointer to location where sign will be stored |
exp | pointer to location where exponent will be stored |
val | pointer to location where value will be stored C pointers to return values. |
int flt32_get_exp | ( | flt32 | x | ) |
int flt32_get_sign | ( | flt32 | x | ) |
int flt32_get_val | ( | flt32 | x | ) |
int flt32_left_most_1 | ( | int | bits | ) |
Subtract to floating point values
x | an integer containing a IEEE floating point value |
y | an integer containing a IEEE floating point value |