diff --git a/src/addition.c b/src/addition.c index 2db8d35..6b17097 100644 --- a/src/addition.c +++ b/src/addition.c @@ -111,11 +111,22 @@ float addition_float(float number1, float number2) { return num3.number.floating; } +// reading sign out of an integer (double number) + unsigned long long sign_double(unsigned long long a) { if (a & 0x8000000000000000) return 1; else return 0; } +// reading precision out of an integer (double number) + unsigned long long precision_double(unsigned long long a) { return a & 0x000fffffffffffff; +} + +// reading exponent out of an integer (double number) + +unsigned long long exponent_double(unsigned long long number) { + unsigned long long exponent = 0x7ff0000000000000; + return (number & exponent) >> 52; } \ No newline at end of file diff --git a/src/addition.h b/src/addition.h index e02a55a..20a8068 100644 --- a/src/addition.h +++ b/src/addition.h @@ -27,4 +27,6 @@ unsigned long long sign_double(unsigned long long a); unsigned long long precision_double(unsigned long long a); +unsigned long long exponent_double(unsigned long long number); + #endif // ADDITION_H \ No newline at end of file