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

static float rand_xorshift32 ( uint32_t seed) [static]

Definition at line 22 of file dither.c.

Referenced by highpass_tpdf_noise(), tpdf_noise(), and white_noise().

{
    union
    {
        uint32_t i;
        float f;
    } fi;
    
    fi.i = *seed;
    fi.i ^= (fi.i<<13);
    fi.i ^= (fi.i>>17);
    fi.i ^= (fi.i<<5);
    *seed = fi.i;
    
    /* scale the number to [-0.5, 0.5] */
#ifdef IEEE_FLOAT
    fi.i = (fi.i>>9)|0x3f800000;
    fi.f -= 1.5f;
#else
    fi.f = (double)fi.i / 4294967295.0;
    fi.f -= 0.5f;
#endif
    return fi.f;
}

Generated on Sun May 27 2012 06:00:52 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.