Skip to content

Commit

Permalink
Fix alternate random_double() implementation
Browse files Browse the repository at this point in the history
Resolves #621
  • Loading branch information
hollasch committed May 30, 2020
1 parent 8b8827b commit 4516a32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ Change Log -- Ray Tracing in One Weekend
- Fix: Missing closing parenthesis in listing 10 (#603)
- Fix: Tiny improvements to the lambertian::scatter() development (#604)
- Fix: Correct geometry type and unit vector method in `ray_color()`, listing 20 (#606)
- Fix: Listing 30, `mixture_pdf` needs `shared_ptr` arguments (#608)
- Fix: Listing 26: alternate `random_double()` switched `distribution`, `generator` (#621)
- Fix: Listing 28, 30: `light_shape` should have default material, not `0` (#607)
- Fix: Listing 30: `mixture_pdf` needs `shared_ptr` arguments (#608)


----------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion books/RayTracingInOneWeekend.html
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@
inline double random_double() {
static std::uniform_real_distribution<double> distribution(0.0, 1.0);
static std::mt19937 generator;
return generator(distribution);
return distribution(generator);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Listing [random-double-alt]: <kbd>[rtweekend.h]</kbd> random_double(), alternate implemenation]
Expand Down

0 comments on commit 4516a32

Please sign in to comment.