Skip to content

Add specialization of MathematicalConstants for GMPField

Simon Praetorius requested to merge issue/mathematical-constants-gmpfield into master

This MR adds a specialization of Dune::MathematicalConstants for Dune::GMPField<precision> by providing an explicit value for the constants pi and e. Note that GMP does not implement cos, acos, exp etc. and thus we cannot use the simple formulas as in the default implementation. Those would compile only, because of the implicit conversion operator, that casts the value to double and calls the std:: functions for double instead.

The MR also extends the test to check for the correct value of the provided constants up to the precision defined in the numeric limits. Also this test uses and explicit provided value for comparison and checks the mismatch by string comparison.

Closes #388 (closed)

Merge request reports

Loading