Add IEEE 754 numbers

Add IEEE 754 numbers

Post by Si » Sun, 22 Feb 2004 23:19:04



How do I add two IEEE 754 numbers?
 
 
 

Add IEEE 754 numbers

Post by Peter » Sun, 22 Feb 2004 23:30:27



> How do I add two IEEE 754 numbers?

That is platform and language dependent.  In most languages I use, a '+'
will do, but you must remember to use the right encoding, be it UTF-8 or,
say ISO 8859-15.  In others, something like HADDPD (case insensitive, most
likely) is necessary.

-Peter

 
 
 

Add IEEE 754 numbers

Post by Si » Sun, 22 Feb 2004 23:52:00





> > How do I add two IEEE 754 numbers?

> That is platform and language dependent.  In most languages I use, a '+'
> will do, but you must remember to use the right encoding, be it UTF-8 or,
> say ISO 8859-15.  In others, something like HADDPD (case insensitive, most
> likely) is necessary.

Thanks for that but I should have been more specific. I meant how do I add
them manually - what are the steps?
 
 
 

Add IEEE 754 numbers

Post by Peter » Mon, 23 Feb 2004 00:08:44



> Thanks for that but I should have been more specific. I meant how do I add
> them manually - what are the steps?

Welcome to comp.arch ;)

How do you add two numbers written in "scientific" notation?

  m_a * 10^e_a  + m_b * 10^e_b

If e_a and e_b are equal then it is simply: (m_a + m_b) * 10^e_a.

And if they are not?  Well, make them equal, of course.

Your turn.

-Peter

 
 
 

Add IEEE 754 numbers

Post by unknow » Thu, 26 Feb 2004 07:06:19





>> Thanks for that but I should have been more specific. I meant how do I
>> add
>> them manually - what are the steps?

> Welcome to comp.arch ;)

> How do you add two numbers written in "scientific" notation?

>   m_a * 10^e_a  + m_b * 10^e_b

> If e_a and e_b are equal then it is simply: (m_a + m_b) * 10^e_a.

> And if they are not?  Well, make them equal, of course.

> Your turn.

> -Peter

He means, shift the significand(mantissa), arithmetically, to the right,
of the number that has the smaller exponent and watch out for cancellation
when the numbers are nearly equal and of opposite signs, you loose digits
that way. Think of it, like each shift to the right increases the exponent
by 1.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

 
 
 

1. difference between IEEE 754 and VAX's exponent biases

Hi.

I've heard that the major differences between the G-format of DEC
VAX and double of IEEE 754 are

1. exponent biases and
2. over/underflow thresholds.

A paper says that IEEE 754 lets numbers grow twice as big as VAX
did without overflow and exponent biases differed by 2.

I suspect that with flushing to zero instead of gradual underflow
DEC VAX's G-format adjusts the over/underflow balance via its
exponent bias to compensate the gap caused by flushing to zero.
Despite googling, I failed to find the span of VAX's G-format.
Could you anyone tell me what the above wording means concretely?

Thanks in advnace.

--

Dept. of Physics, Univ. of Seoul

2. TCP/IP and HTTP problem

3. questions from Kahan's lecture note on IEEE 754

4. Shrink Files

5. HELP: Hex to Float without IEEE 754 (using ibm/360)

6. Easiest way to get keystroke information ?

7. verify IEEE 754 results

8. RR in NYC problem

9. rounding and normalization in IEEE 754

10. Is IEEE 754 a performance limitation?

11. FPU IEEE-754 calculation

12. IEEE 754 encoding and sign-magnitude integer arithmetic

13. IEEE-754 question