IEEE-754

Discussion in 'C++' started by =?ISO-8859-1?Q?Roman_T=F6ngi?=, Aug 23, 2007.

  1. IEEE-754 Arithmetic:
    Most real numbers can't be stored exactly on the computer, but there can
    be stated the range within which a machine number lies.

    For the following example, I assume double precision and the round mode
    in effect to be 'round to nearest' and that the number lies within the
    normalized range:

    Definitions:
    x := real number
    round(x) := correctly rounded normalized number
    eps := machine epsilon (2^(-52) for double precision)
    abs(x) := absolute value of x

    That is:

    round(x) = x*(1 + delta)

    with delta:

    abs(delta) <= 1/2*eps (round to nearest)

    i.d. abs(delta) <= 2^(-53) (double precision)

    abs(delta) corresponds to the relative rounding error.

    Now I can state the range including round(x):

    -----------------------------------------
    x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
    -----------------------------------------

    Is this the correct range according to my assumptions?



    Thanks a lot
    Roman
     
    =?ISO-8859-1?Q?Roman_T=F6ngi?=, Aug 23, 2007
    #1
    1. Advertising

  2. On 2007-08-23 12:54, Roman Töngi wrote:
    > IEEE-754 Arithmetic:
    > Most real numbers can't be stored exactly on the computer, but there can
    > be stated the range within which a machine number lies.
    >
    > For the following example, I assume double precision and the round mode
    > in effect to be 'round to nearest' and that the number lies within the
    > normalized range:
    >
    > Definitions:
    > x := real number
    > round(x) := correctly rounded normalized number
    > eps := machine epsilon (2^(-52) for double precision)
    > abs(x) := absolute value of x
    >
    > That is:
    >
    > round(x) = x*(1 + delta)
    >
    > with delta:
    >
    > abs(delta) <= 1/2*eps (round to nearest)
    >
    > i.d. abs(delta) <= 2^(-53) (double precision)
    >
    > abs(delta) corresponds to the relative rounding error.
    >
    > Now I can state the range including round(x):
    >
    > -----------------------------------------
    > x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
    > -----------------------------------------
    >
    > Is this the correct range according to my assumptions?


    These kinds of questions that have noting to do with C++ (since C++ does
    not require IEEE-754) are better asked in comp.programming.

    --
    Erik Wikström
     
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Aug 23, 2007
    #2
    1. Advertising

  3. Erik Wikström wrote:
    > On 2007-08-23 12:54, Roman Töngi wrote:
    >> IEEE-754 Arithmetic:
    >> Most real numbers can't be stored exactly on the computer, but there can
    >> be stated the range within which a machine number lies.
    >>
    >> For the following example, I assume double precision and the round
    >> mode in effect to be 'round to nearest' and that the number lies
    >> within the
    >> normalized range:
    >>
    >> Definitions:
    >> x := real number
    >> round(x) := correctly rounded normalized number
    >> eps := machine epsilon (2^(-52) for double precision)
    >> abs(x) := absolute value of x
    >>
    >> That is:
    >>
    >> round(x) = x*(1 + delta)
    >>
    >> with delta:
    >>
    >> abs(delta) <= 1/2*eps (round to nearest)
    >>
    >> i.d. abs(delta) <= 2^(-53) (double precision)
    >>
    >> abs(delta) corresponds to the relative rounding error.
    >>
    >> Now I can state the range including round(x):
    >>
    >> -----------------------------------------
    >> x*(1-2(-53)) <= round(x) <= x*(1+2^(-53))
    >> -----------------------------------------
    >>
    >> Is this the correct range according to my assumptions?

    >
    > These kinds of questions that have noting to do with C++ (since C++ does
    > not require IEEE-754) are better asked in comp.programming.
    >

    How does C++ store numbers then?
     
    =?ISO-8859-1?Q?Roman_T=F6ngi?=, Aug 23, 2007
    #3
  4. =?ISO-8859-1?Q?Roman_T=F6ngi?=

    red floyd Guest

    Roman Töngi wrote:
    > Erik Wikström wrote:


    >>
    >> These kinds of questions that have noting to do with C++ (since C++
    >> does not require IEEE-754) are better asked in comp.programming.
    >>

    > How does C++ store numbers then?


    In an implementation dependent manner. The Standard does not impose any
    requirements on *how* an implementation implements floating point
    numbers. An implementation *may choose* to use IEEE-754 (I believe most
    x86 compilers do so), but it is not required to (cf. VAX -- are there
    any left out there?).
     
    red floyd, Aug 23, 2007
    #4
  5. =?ISO-8859-1?Q?Roman_T=F6ngi?=

    Bo Persson Guest

    red floyd wrote:
    :: Roman Töngi wrote:
    ::: Erik Wikström wrote:
    ::
    ::::
    :::: These kinds of questions that have noting to do with C++ (since
    :::: C++ does not require IEEE-754) are better asked in
    :::: comp.programming.
    ::::
    ::: How does C++ store numbers then?
    ::
    :: In an implementation dependent manner. The Standard does not
    :: impose any requirements on *how* an implementation implements
    :: floating point numbers. An implementation *may choose* to use
    :: IEEE-754 (I believe most x86 compilers do so), but it is not
    :: required to (cf. VAX -- are there any left out there?)

    Probably not that many.

    More important is IBM zSeries. Perhaps only 10.000 installations, but
    big systems with BIG companies.

    http://www-03.ibm.com/systems/z/


    Bo Persson
     
    Bo Persson, Aug 23, 2007
    #5
  6. =?ISO-8859-1?Q?Roman_T=F6ngi?=

    red floyd Guest

    Bo Persson wrote:
    > red floyd wrote:
    > :: An implementation *may choose* to use
    > :: IEEE-754 (I believe most x86 compilers do so), but it is not
    > :: required to (cf. VAX -- are there any left out there?)
    >
    > Probably not that many.
    >
    > More important is IBM zSeries. Perhaps only 10.000 installations, but
    > big systems with BIG companies.
    >
    > http://www-03.ibm.com/systems/z/
    >


    Cool. I chose VAX simply because I *knew* it didn't use 754 floating
    point. Didn't know that about the zSeries.
     
    red floyd, Aug 23, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Auronc

    IEEE-754 double class??

    Auronc, Sep 1, 2004, in forum: C++
    Replies:
    0
    Views:
    486
    Auronc
    Sep 1, 2004
  2. Lionel B
    Replies:
    0
    Views:
    1,100
    Lionel B
    Sep 23, 2004
  3. Dale Huffman

    IEEE 754 floats

    Dale Huffman, Sep 14, 2004, in forum: Python
    Replies:
    5
    Views:
    542
    Robert Kern
    Sep 15, 2004
  4. franzkowiak
    Replies:
    9
    Views:
    989
    Tim Peters
    Jan 16, 2005
  5. Grant Edwards
    Replies:
    11
    Views:
    666
    Grant Edwards
    Jul 15, 2005
Loading...

Share This Page