Advertisement
PVS-StudioWarnings

PVS-Studio warning V624 for OpenMS

Nov 21st, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. bool PosteriorErrorProbabilityModel::fit(
  2.   std::vector<double> & search_engine_scores)
  3. {
  4.   ....
  5.   incorrectly_assigned_fit_param_.A =
  6.     1 / sqrt(2 * 3.14159 *
  7.              pow(incorrectly_assigned_fit_param_.sigma, 2));
  8.   ....
  9. }
  10.  
  11. This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V624 The constant 3.14159 is being utilized. The resulting value could be inaccurate. Consider using the M_PI constant from <math.h>. posteriorerrorprobabilitymodel.c 92
  14.  
  15. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement