Skip to content

1.9.1: improbable but not impossible divide-by-zero #1606

@whydoubt

Description

@whydoubt

Inside random_unit_vector(), if random_in_unit_sphere() returns a vector very close to
zero, passing that to unit_vector() could result in a divide-by-zero fault.

One way to avoid this would be if the rejection method in random_in_unit_sphere() also
rejected near-zero values. There is a near_zero() function introduced later (in 10.3), that
would be useful here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions