tests/cuda4.1sdk/tests/fluidsGL/fluidsGL.cpp
float myrand(void)
{
    static int seed = 72191;
    char sq[22];

    if (g_bQAReadback) {
        seed *= seed;
        sprintf(sq, "%010d", seed);
        // pull the middle 5 digits out of sq
        sq[8] = 0;
        seed = atoi(&sq[3]);

        return seed/99999.f;
    } else {
        return rand()/(float)RAND_MAX;
    }
}
// very simple von neumann middle-square prng.  can't use rand() in -qatest
// mode because its implementation varies across platforms which makes testing
// for consistency in the important parts of this program difficult.
very simple von neumann middle-square prng.  can't use rand() in -qatest
mode because its implementation varies across platforms which makes testing
for consistency in the important parts of this program difficult.
very simple von neumann middle - square prng . can ' t use rand () in - qatest mode because its implementation varies across platforms which makes testing for consistency in the important parts of this program difficult .
float myrand(void)
{
    static int seed = 72191;
    char sq[22];
    if (g_bQAReadback) {
        seed *= seed;
        sprintf(sq, "%010d", seed);
        sq[8] = 0;
        seed = atoi(&sq[3]);
        return seed/99999.f;
    } else {
        return rand()/(float)RAND_MAX;
    }
}
float myrand ( void ) { static int seed = 72191 ; char sq [ 22 ] ; if ( g_bQAReadback ) { seed *= seed ; sprintf ( sq , " " , seed ) ; sq [ 8 ] = 0 ; seed = atoi ( & sq [ 3 ] ) ; return seed / 99999.f ; } else { return rand ( ) / ( float ) RAND_MAX ; } }
very simple von neumann middle-square prng.
very simple von neumann middle - square prng .
// pull the middle 5 digits out of sq