# Boost-Commit :

From: bruno.lalande_at_[hidden]
Date: 2009-06-28 05:24:54

Author: bruno.lalande
Date: 2009-06-28 05:24:53 EDT (Sun, 28 Jun 2009)
New Revision: 54461
URL: http://svn.boost.org/trac/boost/changeset/54461

Log:
Added a test for trigonometric functions, and added some missing functions in policies.
Text files modified:
3 files changed, 25 insertions(+), 0 deletions(-)

==============================================================================
@@ -70,6 +70,16 @@
r = cln::sin(a);
}

+ static inline void tan(value_type& r, value_type const& a)
+ {
+ r = cln::tan(a);
+ }
+
+ static inline void atan(value_type& r, value_type const& a)
+ {
+ r = cln::atan(a);
+ }
+
static inline void hypot(value_type& r, value_type const& a, value_type const& b)
{
r = cln::sqrt(a * a + b * b);

==============================================================================
@@ -122,6 +122,20 @@
mpf_set_d(r, std::sin(d));
}

+ static inline void tan(value_type& r, value_type const& a)
+ {
+ // TAN is not available in GMP
+ long double d = mpf_get_d(a);
+ mpf_set_d(r, std::tan(d));
+ }
+
+ static inline void atan(value_type& r, value_type const& a)
+ {
+ // ATAN is not available in GMP
+ long double d = mpf_get_d(a);
+ mpf_set_d(r, std::atan(d));
+ }
+
static inline void hypot(value_type& r, value_type const& a, value_type const& b)
{
mpf_mul(r, a, a);

==============================================================================
@@ -20,4 +20,5 @@

run test_heron.cpp ;
run test_arithmetic.cpp ;
+run test_trig.cpp ;
run test_conversions.cpp ;

==============================================================================
--- (empty file)
@@ -0,0 +1,56 @@
+// Numeric Adaptor Library testing suite
+//
+// Copyright Barend Gehrels 2009, Geodan Holding B.V. Amsterdam, the Netherlands.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+
+#if defined(HAVE_GMP)
+#endif
+
+#if defined(HAVE_CLN)
+#endif
+
+
+template <typename Policy>
+void test_all()
+{
+
+ // big epsilon since we're testing functionalities, not robustness
+ double epsilon = 0.1;
+
+ num n1 = 123.0;
+ num n2 = 456.0;
+}
+
+int test_main(int, char*[])
+{