Skip to content

Commit

Permalink
fix(autoware_lidar_apollo_instance_segmentation): fix cppcheck suspic…
Browse files Browse the repository at this point in the history
…iousFloatingPointCast (#9195)

Signed-off-by: Ryuta Kambe <[email protected]>
  • Loading branch information
veqcc authored Nov 6, 2024
1 parent f6bfbbe commit 312004f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct LogTable
{
data.resize(256 * 10);
for (size_t i = 0; i < data.size(); ++i) {
data[i] = std::log1p(static_cast<float>(i / 10.0));
data[i] = std::log1p(static_cast<float>(i) * 0.1f);
}
}
};
Expand All @@ -44,7 +44,7 @@ float calcApproximateLog(float num)
if (integer_num < static_cast<int>(log_table.data.size())) {
return log_table.data[integer_num];
}
return std::log(static_cast<float>(1.0 + num));
return std::log1p(num);
}
} // namespace lidar_apollo_instance_segmentation
} // namespace autoware

0 comments on commit 312004f

Please sign in to comment.