Siv3D/include/ThirdParty/SFMT/SFMT.hpp
inline static uint64_t sfmt_genrand_uint64(sfmt_t * sfmt) {
#if defined(BIG_ENDIAN64) && !defined(ONLY64)
		uint32_t * psfmt32 = &sfmt->state[0].u[0];
		uint32_t r1, r2;
#else
		uint64_t r;
#endif
		uint64_t * psfmt64 = &sfmt->state[0].u64[0];
		assert(sfmt->idx % 2 == 0);

		if (sfmt->idx >= SFMT_N32) {
			sfmt_gen_rand_all(sfmt);
			sfmt->idx = 0;
		}
#if defined(BIG_ENDIAN64) && !defined(ONLY64)
		r1 = psfmt32[sfmt->idx];
		r2 = psfmt32[sfmt->idx + 1];
		sfmt->idx += 2;
		return ((uint64_t)r2 << 32) | r1;
#else
		r = psfmt64[sfmt->idx / 2];
		sfmt->idx += 2;
		return r;
#endif
	}
/**
	* This function generates and returns 64-bit pseudorandom number.
	* init_gen_rand or init_by_array must be called before this function.
	* The function gen_rand64 should not be called after gen_rand32,
	* unless an initialization is again executed.
	* @param sfmt SFMT internal state
	* @return 64-bit pseudorandom number
	*/
This function generates and returns 64-bit pseudorandom number.
init_gen_rand or init_by_array must be called before this function.
The function gen_rand64 should not be called after gen_rand32,
unless an initialization is again executed.
@param sfmt SFMT internal state
@return 64-bit pseudorandom number
This function generates and returns 64 - bit pseudorandom number . init_gen_rand or init_by_array must be called before this function . The function gen_rand64 should not be called after gen_rand32 unless an initialization is again executed . @param sfmt SFMT internal state @return 64 - bit pseudorandom number
inline static uint64_t sfmt_genrand_uint64(sfmt_t * sfmt) {
#if defined(BIG_ENDIAN64) && !defined(ONLY64)
		uint32_t * psfmt32 = &sfmt->state[0].u[0];
		uint32_t r1, r2;
#else
		uint64_t r;
#endif
		uint64_t * psfmt64 = &sfmt->state[0].u64[0];
		assert(sfmt->idx % 2 == 0);
		if (sfmt->idx >= SFMT_N32) {
			sfmt_gen_rand_all(sfmt);
			sfmt->idx = 0;
		}
#if defined(BIG_ENDIAN64) && !defined(ONLY64)
		r1 = psfmt32[sfmt->idx];
		r2 = psfmt32[sfmt->idx + 1];
		sfmt->idx += 2;
		return ((uint64_t)r2 << 32) | r1;
#else
		r = psfmt64[sfmt->idx / 2];
		sfmt->idx += 2;
		return r;
#endif
	}
inline static uint64_t sfmt_genrand_uint64 ( sfmt_t * sfmt ) { #if defined ( BIG_ENDIAN64 ) && ! defined ( ONLY64 ) uint32_t * psfmt32 = & sfmt -> state [ 0 ] . u [ 0 ] ; uint32_t r1 , r2 ; #else uint64_t r ; #endif uint64_t * psfmt64 = & sfmt -> state [ 0 ] . u64 [ 0 ] ; assert ( sfmt -> idx % 2 == 0 ) ; if ( sfmt -> idx >= SFMT_N32 ) { sfmt_gen_rand_all ( sfmt ) ; sfmt -> idx = 0 ; } #if defined ( BIG_ENDIAN64 ) && ! defined ( ONLY64 ) r1 = psfmt32 [ sfmt -> idx ] ; r2 = psfmt32 [ sfmt -> idx + 1 ] ; sfmt -> idx += 2 ; return ( ( uint64_t ) r2 << 32 ) | r1 ; #else r = psfmt64 [ sfmt -> idx / 2 ] ; sfmt -> idx += 2 ; return r ; #endif }
This function generates and returns 64-bit pseudorandom number.
This function generates and returns 64 - bit pseudorandom number .