if $x=1.0e38=1.0 * 10^{38}$ and $y=3.0$
i want to find $ (x-x)+y $ and $(x+y)-x$
i think the value of (x-x)+y will be just substract $x-x=0 + y=3.0 = 3.0$
but how can i perfom addition of different base? $(x+y)-x$
i think the idea is addition $(x+y)$ then substract $-x$ using floating point, i tried to convert $y=3.0$ to binary such as $1.1 * 2^1$
but how about $10^{38}$ to binary ?
2026-03-25 04:35:34.1774413334
On
binary floating point perform substraction and addition
57 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
1
On
I think it is a moot point. Unless you are willing to use an 'unlimited precision' software package, for any floating-point system with a reasonable number of digits in the mantissa (in any base you like), the digits of '$3.0$' will be shifted so far to the right of the radix point of '$1.0*10^{38}$' as to be dropped completely, hence the calculated value of '$(x+y)-x$' will end up as zero.
You have to define what floating point format you are using. Standard IEEE $64-$bit floating point assigns $53$ bits to the mantissa, giving a precision of about $16$ decimal digits. $10^{38}$ will be represented by some $53$ bit mantissa times a binary exponent. To add to that, you have to match the exponents, and $3.0$ will be shifted far to the right, which means in floating point $10^{38}+3.0=10^{38}$ exactly and when you subtract off $10^{38}$ you will get $0$. As long as the larger number is at least $10^{16}$ times the smaller this will happen.