Skip to content

Commit 40814b7

Browse files
authored
Merge pull request #925 from ahcox/patch-2
Removed add/sub of small floats to/from large ones
2 parents 7155928 + e3f3f84 commit 40814b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,9 +2007,9 @@
20072007

20082008
if (world.hit(r, interval(0.001, infinity), rec)) {
20092009
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
2010-
point3 target = rec.p + random_in_hemisphere(rec.normal);
2010+
vec3 direction = random_in_hemisphere(rec.normal);
2011+
return 0.5 * ray_color(ray(rec.p, direction), world, depth-1);
20112012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
2012-
return 0.5 * ray_color(ray(rec.p, target - rec.p), world, depth-1);
20132013
}
20142014

20152015
vec3 unit_direction = unit_vector(r.direction());

0 commit comments

Comments
 (0)