Skip to content

Commit 61a4f86

Browse files
authored
Merge pull request #627 from RayTracing/fix-621
Fix alternate random_double() implementation
2 parents 8b8827b + 4516a32 commit 61a4f86

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ Change Log -- Ray Tracing in One Weekend
1111
- Fix: Missing closing parenthesis in listing 10 (#603)
1212
- Fix: Tiny improvements to the lambertian::scatter() development (#604)
1313
- Fix: Correct geometry type and unit vector method in `ray_color()`, listing 20 (#606)
14-
- Fix: Listing 30, `mixture_pdf` needs `shared_ptr` arguments (#608)
14+
- Fix: Listing 26: alternate `random_double()` switched `distribution`, `generator` (#621)
1515
- Fix: Listing 28, 30: `light_shape` should have default material, not `0` (#607)
16+
- Fix: Listing 30: `mixture_pdf` needs `shared_ptr` arguments (#608)
1617

1718

1819
----------------------------------------------------------------------------------------------------

books/RayTracingInOneWeekend.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@
13151315
inline double random_double() {
13161316
static std::uniform_real_distribution<double> distribution(0.0, 1.0);
13171317
static std::mt19937 generator;
1318-
return generator(distribution);
1318+
return distribution(generator);
13191319
}
13201320
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13211321
[Listing [random-double-alt]: <kbd>[rtweekend.h]</kbd> random_double(), alternate implemenation]

0 commit comments

Comments
 (0)