Refactoring #1076

make math code more readable

Added by wuttke over 5 years ago. Updated over 5 years ago.

Status:RejectedStart date:12 May 2015
Priority:LowDue date:
Assignee:-% Done:


Target version:-


Adapt extant math code (e.g. form factor calculations) to the following agreed conventions:
  • In a source file that contains several calls to sqrt, exp, sin, and the like: use "using namespace std"
  • Ditto, when there are calls to sinc: "using namespace MathFunctions"
  • Change Sinc into sinc: when it comes to the readability of formulae, math conventions are more important than project-wide coding conventions
  • At single source file level, define I = complex_t(0.0, 1.0).
  • Add function sqr(x)=x*x to MathFunctions
  • Never introduce auxiliary variables like m_root3 = std::sqrt(3.0); leave it to the compiler to replace 'sqrt(3) by a constant.


#1 Updated by wuttke over 5 years ago

  • Subject changed from to discuss: conventions to make math code more readable to make math code more readable
  • Description updated (diff)
  • Status changed from New to Long Term Idea
  • Priority changed from Normal to Low

#2 Updated by wuttke over 5 years ago

  • Status changed from Long Term Idea to Rejected

no need to have this in the issue tracker; let's just improve things as we pass by

Also available in: Atom PDF