Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
constants.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file numeric/constants.cc
11 /// @brief Common numeric constants in varying precisions
12 /// @author Frank M. D'Ippolito (Objexx@objexx.com)
13 /// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
14 /// @note The 'constants' namespace and the namespaces within it
15 // do not correspond to any package
16 
17 
18 // Package headers
19 #include <numeric/constants.hh>
20 #include <numeric/NumericTraits.hh>
21 
22 
23 namespace numeric {
24 namespace constants {
25 
26 
27 // float
28 namespace f {
29 
31 
33 Type const one = Traits::one();
34 Type const two = Traits::two();
35 Type const pi = Traits::pi();
45 
46 } // namespace f
47 
48 
49 // double
50 namespace d {
51 
53 
55 Type const one = Traits::one();
56 Type const two = Traits::two();
57 Type const pi = Traits::pi();
67 
68 } // namespace d
69 
70 
71 // long double
72 namespace ld {
73 
75 
77 Type const one = Traits::one();
78 Type const two = Traits::two();
79 Type const pi = Traits::pi();
89 
90 } // namespace ld
91 
92 
93 // Real
94 namespace r {
95 
97 
99 Type const one = Traits::one();
100 Type const two = Traits::two();
101 Type const pi = Traits::pi();
111 
112 } // namespace r
113 
114 
115 } // namespace constants
116 } // namespace numeric
Type const pi_over_2
Definition: constants.cc:37
Type const pi_over_180
Definition: constants.cc:62
Type const pi_over_180
Definition: constants.cc:40
Type const pi_over_2
Definition: constants.cc:103
Numeric type traits.
Type const deg2rad
Definition: constants.cc:42
NumericTraits< Type > Traits
Definition: constants.cc:74
static Type degrees_to_radians()
pi/180
static Type two()
Two.
NumericTraits: Numeric type traits.
static Type pi_over_3()
pi/3
static Type pi_over_180()
pi/180
Type const pi_over_3
Definition: constants.cc:38
static Type pi_2_over_3()
(2*pi)/3
Type const pi_over_3
Definition: constants.cc:82
Type const pi_2_over_3
Definition: constants.cc:61
Type const pi_over_180
Definition: constants.cc:106
static Type pi_2()
2*pi
static Type one()
One.
Type const radians_to_degrees
Definition: constants.cc:65
Type const radians_to_degrees
Definition: constants.cc:87
Type const pi_2_over_3
Definition: constants.cc:39
static Type radians_to_degrees()
180/pi
NumericTraits< Type > Traits
Definition: constants.cc:96
Type const degrees_to_radians
Definition: constants.cc:41
Type const degrees_to_radians
Definition: constants.cc:107
Type const rad2deg
Definition: constants.cc:66
Type const radians_to_degrees
Definition: constants.cc:43
Type const radians_to_degrees
Definition: constants.cc:109
Type const rad2deg
Definition: constants.cc:44
Type const pi_2_over_3
Definition: constants.cc:83
Type const pi_over_2
Definition: constants.cc:81
Type const pi_2_over_3
Definition: constants.cc:105
NumericTraits< Type > Traits
Definition: constants.cc:52
static Type pi_over_2()
pi/2
Type const pi_over_2
Definition: constants.cc:59
static Type rad2deg()
180/pi
Type const degrees_to_radians
Definition: constants.cc:63
Type const pi_over_3
Definition: constants.cc:60
NumericTraits< Type > Traits
Definition: constants.cc:30
Common numeric constants in varying precisions.
static Type zero()
Zero.
static Type pi()
pi
static Type deg2rad()
pi/180
Type const deg2rad
Definition: constants.cc:64
Type const degrees_to_radians
Definition: constants.cc:85
Type const pi_over_180
Definition: constants.cc:84
Type const pi_over_3
Definition: constants.cc:104