Browse Source

addition read exponent of a floating number

master
Dennis Sperzel 11 months ago
parent
commit
978a20ee7c
  1. 7
      src/addition.c
  2. 2
      src/addition.h

7
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) {

2
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
Loading…
Cancel
Save