diff --git a/src/addition.c b/src/addition.c index 724dd99..6afc239 100644 --- a/src/addition.c +++ b/src/addition.c @@ -41,6 +41,13 @@ unsigned int precision(unsigned int number) { return (number & precision); } +// reading exponent out of an integer (floating number) + +unsigned int e(unsigned int a) { + unsigned int e = 2139095040; + return (a & e) >> 23; +} + // addition of two floating numbers float addition_float(float number1, float number2) { diff --git a/src/addition.h b/src/addition.h index cf09c60..86dd0a4 100644 --- a/src/addition.h +++ b/src/addition.h @@ -11,6 +11,8 @@ unsigned int sign(unsigned int number); unsigned int precision(unsigned int number); +unsigned int e(unsigned int a); + float addition_float(float number1, float number2); -#endif // ADDITION_H +#endif // ADDITION_H \ No newline at end of file