ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

double modf ( double  x,
double *  iptr 
)

Definition at line 150 of file s_modf.c.

Referenced by cvt(), CMathTest::import_checks(), logic_dbl2int(), modff(), modfl(), rpn_dec2dms(), rpn_dms2dec(), rpn_exp10(), rpn_frac(), rpn_int(), rpn_mod_f(), rpn_shl_f(), rpn_shr_f(), and TRIO_ARGS1().

{
    __int32_t i0,i1,j_0;
    __uint32_t i;
    EXTRACT_WORDS(i0,i1,x);
    j_0 = ((i0>>20)&0x7ff)-0x3ff;   /* exponent of x */
    if(j_0<20) {            /* integer part in high x */
        if(j_0<0) {         /* |x|<1 */
            INSERT_WORDS(*iptr,i0&0x80000000U,0);   /* *iptr = +-0 */
        return x;
        } else {
        i = (0x000fffff)>>j_0;
        if(((i0&i)|i1)==0) {        /* x is integral */
            __uint32_t high;
            *iptr = x;
            GET_HIGH_WORD(high,x);
            INSERT_WORDS(x,high&0x80000000U,0); /* return +-0 */
            return x;
        } else {
            INSERT_WORDS(*iptr,i0&(~i),0);
            return x - *iptr;
        }
        }
    } else if (j_0>51) {        /* no fraction part */
        __uint32_t high;
        *iptr = x*one;
        GET_HIGH_WORD(high,x);
        INSERT_WORDS(x,high&0x80000000U,0); /* return +-0 */
        return x;
    } else {            /* fraction part in low x */
        i = ((__uint32_t)(0xffffffffU))>>(j_0-20);
        if((i1&i)==0) {         /* x is integral */
            __uint32_t high;
        *iptr = x;
        GET_HIGH_WORD(high,x);
        INSERT_WORDS(x,high&0x80000000U,0); /* return +-0 */
        return x;
        } else {
            INSERT_WORDS(*iptr,i0,i1&(~i));
        return x - *iptr;
        }
    }
}

Generated on Fri May 25 2012 06:03:09 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.