aboutsummaryrefslogtreecommitdiff
path: root/src/util/numeric.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-04-03 23:05:22 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2018-04-03 23:05:22 +0200
commit05fe3b06c80fc7fa438ed5faf5805c79a92789e9 (patch)
tree160ec2fa0bb26cedcdfeb2e330ba1d41107dd158 /src/util/numeric.cpp
parent4827f754ec9efc1e1fa8e519eaa211ed768e25c0 (diff)
downloadminetest-05fe3b06c80fc7fa438ed5faf5805c79a92789e9.tar.gz
minetest-05fe3b06c80fc7fa438ed5faf5805c79a92789e9.tar.bz2
minetest-05fe3b06c80fc7fa438ed5faf5805c79a92789e9.zip
Fix last clang-tidy reported problems for performance-type-promotion-in-math-fn
Based on https://travis-ci.org/minetest/minetest/jobs/361810382 output Also fix 2 missing copyright notices
Diffstat (limited to 'src/util/numeric.cpp')
-rw-r--r--src/util/numeric.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp
index cb984d8cb..b88b4d545 100644
--- a/src/util/numeric.cpp
+++ b/src/util/numeric.cpp
@@ -157,7 +157,7 @@ bool isBlockInSight(v3s16 blockpos_b, v3f camera_pos, v3f camera_dir,
// HOTFIX: use sligthly increased angle (+10%) to fix too agressive
// culling. Somebody have to find out whats wrong with the math here.
// Previous value: camera_fov / 2
- if(cosangle < cos(camera_fov * 0.55))
+ if (cosangle < std::cos(camera_fov * 0.55f))
return false;
return true;
@@ -172,6 +172,6 @@ s16 adjustDist(s16 dist, float zoom_fov)
return dist;
// new_dist = dist * ((1 - cos(FOV / 2)) / (1-cos(zoomFOV /2))) ^ (1/3)
- return round(dist * cbrt((1.0f - std::cos(default_fov / 2.0f)) /
+ return round(dist * std::cbrt((1.0f - std::cos(default_fov / 2.0f)) /
(1.0f - std::cos(zoom_fov / 2.0f))));
}