From 29a4d6cae70502218c5c07c660cb00c397175832 Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Tue, 6 Feb 2024 10:28:55 +0100 Subject: [PATCH] addition addition_precision sum of two precisions --- src/addition.c | 6 ++++++ src/addition.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/addition.c b/src/addition.c index fd74c3e..e311e57 100644 --- a/src/addition.c +++ b/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) { diff --git a/src/addition.h b/src/addition.h index 2d2878f..fcbf305 100644 --- a/src/addition.h +++ b/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);