Are multiplication and division of double exactly defined under C99with __STDC_IEC_559__ ?

Discussion in 'C Programming' started by Francois Grieu, Jun 8, 2010.

  1. Assume a conforming C99 implementation that defines __STDC_IEC_559__.
    Unless I err, "double" is a floating point type capable of exactly
    representing all integers in the range [0..0x1FFFFFFFFFFFFF] (that's 53
    bit). Also assume FE_TONEAREST is in effect.

    Can it be said that multiplication and division of double are exactly
    defined? Or/and that the result of the following functions is fully
    specified when x and y are in range [0..0x1FFFFFFFFFFFFF]?


    typedef unsigned long long tu53;

    tu53 mym(tu53 x, tu53 y)
    { return ( x * 1p-53 ) * y ; }

    tu53 myd(tu53 x, tu53 y)
    { return y > x ? ( x * 1p53 ) / y : 0; }


    TIA,

    Francois Grieu
    Francois Grieu, Jun 8, 2010
    #1
    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. Replies:
    1
    Views:
    795
    Thomas Matthews
    Jan 21, 2005
  2. Sydex
    Replies:
    12
    Views:
    6,485
    Victor Bazarov
    Feb 17, 2005
  3. William Hughes
    Replies:
    13
    Views:
    1,215
    Ben Bacarisse
    Mar 15, 2010
  4. Francois Grieu
    Replies:
    2
    Views:
    365
    Francois Grieu
    Jun 10, 2010
  5. Keith Thompson

    Re: __STDC_IEC_559__ (defined or !defined ?)

    Keith Thompson, Aug 17, 2010, in forum: C Programming
    Replies:
    0
    Views:
    442
    Keith Thompson
    Aug 17, 2010
Loading...

Share This Page