Browse Source

addition reading precision out of double numbers

master
Dennis Sperzel 11 months ago
parent
commit
8f20eaafb8
  1. 5
      src/addition.c
  2. 2
      src/addition.h

5
src/addition.c

@ -115,3 +115,8 @@ unsigned long sign_double(unsigned long a) {
if (a & 0x8000000000000000 == 0x8000000000000000) return 1; if (a & 0x8000000000000000 == 0x8000000000000000) return 1;
else return 0; else return 0;
} }
unsigned long precision_double(unsigned long a) {
a &= 0x000fffffffffffff;
return a;
}

2
src/addition.h

@ -25,4 +25,6 @@ float addition_float(float number1, float number2);
unsigned long sign_double(unsigned long a); unsigned long sign_double(unsigned long a);
unsigned long precision_double(unsigned long a);
#endif // ADDITION_H #endif // ADDITION_H
Loading…
Cancel
Save