Skip to content

Book2: Listing 33, 34, 38: explicit cast #692

@estshorter

Description

@estshorter

Implicit cast from double to int generates a compilation warning.
Explicit cast is better.

int i = static_cast<int>(floor(p.x()));
int j = static_cast<int>(floor(p.y()));
int k = static_cast<int>(floor(p.z()));

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions