Changeset 60945 in webkit for trunk/JavaScriptCore/wtf/RandomNumber.cpp
- Timestamp:
- Jun 10, 2010, 1:49:45 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/RandomNumber.cpp
r53928 r60945 48 48 49 49 namespace WTF { 50 51 double weakRandomNumber()52 {53 #if COMPILER(MSVC) && defined(_CRT_RAND_S)54 // rand_s is incredibly slow on windows so we fall back on rand for Math.random55 return (rand() + (rand() / (RAND_MAX + 1.0))) / (RAND_MAX + 1.0);56 #elif PLATFORM(BREWMP)57 uint32_t bits;58 GETRAND(reinterpret_cast<byte*>(&bits), sizeof(uint32_t));59 return static_cast<double>(bits) / (static_cast<double>(std::numeric_limits<uint32_t>::max()) + 1.0);60 #else61 return randomNumber();62 #endif63 }64 50 65 51 double randomNumber()
Note:
See TracChangeset
for help on using the changeset viewer.