C++中的各种数据类型的理论值范围
发布时间
阅读量:
阅读量
背景:
在手动获取点云的bounding box过程中,发现确定点云bounding box最大最小值时,需要将最大最小值的初始值设定为对应数据类型的理论数值上下界,且该初始值应为float类型。
1. 如何获取不同数据类型(如int、float等)的理论数值范围:
max_point = std::numeric_limits <float>::max();
2. 实用价值:
以下内容可用于确定初始阶段的最大与最小数值。
void getBoundingBox(pcl::PointCloud<PointTypeIO>::Ptr cloud_in, PointTypeIO& min_point, PointTypeIO& max_point, Eigen::Vector3f &mass_center){
max_point.x = -std::numeric_limits <float>::max();
max_point.y = -std::numeric_limits <float>::max();
max_point.z = -std::numeric_limits <float>::max();
min_poi
全部评论 (0)
还没有任何评论哟~
