i have made a new data type which named LongDouble
it takes 16 byte to save the number
the first bit for the sign
the next 15 bit for the exponent
the other 112 bit for the mantissa
, i have to apply four operation on these numbers , but i have a problem in addition , when the sign for any of the numbers is negative ,how i can perform the operation , also if there is a Mantissa how i can also perform the operation ????????
if i try to save mantissa in a variable there would a loss of precision ...
First, I presume you are normalizing your data. It seems like a weird concept, but it is actually very important for floating point math.
Remember also that without the sign, a number is just magnitude. When signs equal (both are positive or both are negative), then you just add magnitudes.
Only when signs are unequal (one is positive and one is negative) do you you have to care about finding the difference between them, and assigning the correct sign to the result.
Hope this helps.
[edit]
BTW, how do you plan to print your numbers? The code to do that is deep black magic.