diff --git a/src/addition.c b/src/addition.c index 6b17097..5dcd167 100644 --- a/src/addition.c +++ b/src/addition.c @@ -77,7 +77,7 @@ unsigned int addition_precision_float(unsigned int p1, unsigned int p2) { return addition_uint(p1, p2); } -// writing number out of sign, exponent and precision +// writing floating number out of sign, exponent and precision unsigned int output_float(unsigned int sign, unsigned int exponent, unsigned int precision) { return (sign << 31) | (exponent << 23) | precision; @@ -129,4 +129,10 @@ unsigned long long precision_double(unsigned long long a) { unsigned long long exponent_double(unsigned long long number) { unsigned long long exponent = 0x7ff0000000000000; return (number & exponent) >> 52; +} + +// writing double number out of sign, exponent and precision + +unsigned long long output_double(unsigned long long sign, unsigned long long exponent, unsigned long long precision) { + return (sign << 63) | (exponent << 52) | precision; } \ No newline at end of file diff --git a/src/addition.h b/src/addition.h index 20a8068..0ed5aec 100644 --- a/src/addition.h +++ b/src/addition.h @@ -29,4 +29,6 @@ unsigned long long precision_double(unsigned long long a); unsigned long long exponent_double(unsigned long long number); +unsigned long long output_double(unsigned long long sign, unsigned long long exponent, unsigned long long precision); + #endif // ADDITION_H \ No newline at end of file