Skip to content

Commit

Permalink
Changed rand() to <random> in HalfTest/testError.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Sep 14, 2019
1 parent 028a191 commit f28b353
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions IlmBase/HalfTest/testError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <iostream>
#include <stdlib.h>
#include <assert.h>

#include <random>

using namespace std;

Expand All @@ -21,7 +21,10 @@ namespace {
float
drand()
{
return static_cast<float> (rand()/(RAND_MAX+1.0f));
static std::default_random_engine generator;
static std::uniform_real_distribution<float> distribution (0.0f, 1.0f);
float r = distribution (generator);
return r;
}

} // namespace
Expand Down

0 comments on commit f28b353

Please sign in to comment.