Browse Source

addition addition_precision sum of two precisions

master
Dennis Sperzel 11 months ago
parent
commit
29a4d6cae7
  1. 6
      src/addition.c
  2. 2
      src/addition.h

6
src/addition.c

@ -48,6 +48,12 @@ unsigned int exponent(unsigned int number) {
return (number & exponent) >> 23;
}
// adding two precision together with sum < 2^24
unsigned int addition_precision(unsigned int p1, unsigned int p2) {
return addition(p1, p2);
}
// writing number out of sign, exponent and precision
unsigned int output(unsigned int sign, unsigned int exponent, unsigned int precision) {

2
src/addition.h

@ -13,6 +13,8 @@ unsigned int precision(unsigned int number);
unsigned int exponent(unsigned int number);
unsigned int addition_precision(unsigned int p1, unsigned int p2);
unsigned int output(unsigned int sign, unsigned int exponent, unsigned int precision);
float addition_float(float number1, float number2);

Loading…
Cancel
Save