source:
GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/gfx/math/random.h
@
774
Revision 774, 415 bytes checked in by gumbau, 18 years ago (diff) |
---|
Line | |
---|---|
1 | #ifndef GFXMATH_RANDOM_INCLUDED // -*- C++ -*- |
2 | #define GFXMATH_RANDOM_INCLUDED |
3 | |
4 | #include <stdlib.h> |
5 | #include <limits.h> |
6 | |
7 | namespace qslim |
8 | { |
9 | // |
10 | // Generate random numbers in [0..1] |
11 | inline real random1() |
12 | { |
13 | #if defined(WIN32) || defined(GFX_USE_RAND) |
14 | return (real)rand() / (real)LONG_MAX; |
15 | #else |
16 | return (real)random() / (real)LONG_MAX; |
17 | #endif |
18 | } |
19 | |
20 | } |
21 | |
22 | |
23 | // GFXMATH_RANDOM_INCLUDED |
24 | #endif |
Note: See TracBrowser
for help on using the repository browser.