Skip to content

Commit ce1476a

Browse files
authored
Update raytrace benchmark to work with native floats (#47)
Related to python/mypy#14880.
1 parent f037b55 commit ce1476a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmarks/bm_raytrace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def __init__(self) -> None:
259259
self.lightPoints: list[Point] = []
260260
self.position = Point(0, 1.8, 10)
261261
self.lookingAt = Point_ZERO
262-
self.fieldOfView: float = 45
262+
self.fieldOfView: float = 45.0
263263
self.recursionDepth = 0
264264

265265
def moveTo(self, p: Point) -> None:
@@ -363,7 +363,7 @@ def colourAt(self, scene: Scene, ray: Ray, p: Point, normal: Vector) -> Colour:
363363
c = addColours(c, self.specularCoefficient, reflectedColour)
364364

365365
if self.lambertCoefficient > 0:
366-
lambertAmount: float = 0
366+
lambertAmount: float = 0.0
367367
for lightPoint in scene.visibleLights(p):
368368
contribution = (lightPoint - p).normalized().dot(normal)
369369
if contribution > 0:

0 commit comments

Comments
 (0)