@@ -14,16 +14,14 @@ constexpr int r2i(double value) { return static_cast<int>(value >= 0.0 ? value +
14
14
*/
15
15
void initialize () {
16
16
units::AccelerationPose a (1_mps2, 2_mps2);
17
- Number num = Number (1.0 );
18
- num = Number (0.0 );
19
17
a.orientation = Quantity<std::ratio<0 >, std::ratio<0 >, std::ratio<-2 >, std::ratio<0 >, std::ratio<1 >, std::ratio<0 >,
20
18
std::ratio<0 >, std::ratio<0 >>(1.0 );
21
19
a.orientation += 2_rpm2;
22
20
2_rpm2 -= a.orientation ;
23
21
Quantity<std::ratio<0 >, std::ratio<0 >, std::ratio<1 >, std::ratio<0 >, std::ratio<1 >, std::ratio<0 >, std::ratio<0 >,
24
22
std::ratio<0 >>
25
23
c = Multiplied<Angle, Time>();
26
- Length x = unit_cast<Length>(num );
24
+ Length x = unit_cast<Length>(2_cm );
27
25
Angle y = toAngular<Length>(x, 2_cm);
28
26
Length z = toLinear<Angle>(y, 2_cm);
29
27
static_assert (Angle (5.1 ) >= Quantity<std::ratio<0 >, std::ratio<0 >, std::ratio<0 >, std::ratio<0 >, std::ratio<1 >,
@@ -35,13 +33,11 @@ void initialize() {
35
33
units::Vector3D<Length> v3b = units::V3Position (2_in, 2_in, 2_in) / 2.0 ;
36
34
units::Vector3D<Area> v3c = 2_in * units::V3Position (2_in, 2_in, 2_in);
37
35
units::Vector3D<Area> v3d = units::V3Position (2_in, 2_in, 2_in) * 2_in;
38
- units::Vector3D<Number> v3e = units::V3Position (2_in, 2_in, 2_in) / 2_in;
39
36
// check Vector2D overloads
40
37
units::Vector2D<Length> v2a = units::V2Position (2_in, 2_in) / 2 ;
41
38
units::Vector2D<Length> v2b = 2 * units::V2Position (2_in, 2_in) * 2 ;
42
39
units::Vector2D<Area> v2c = 2_in * units::V2Position (2_in, 2_in);
43
40
units::Vector2D<Area> v2d = units::V2Position (2_in, 2_in) * 2_in;
44
- units::Vector2D<Number> v2e = units::V2Position (2_in, 2_in) / 2_in;
45
41
}
46
42
47
43
constexpr void angleTests () {
@@ -57,36 +53,4 @@ constexpr void angleRangeTests() {
57
53
Angle a = 2_stDeg + AngleRange (15_stDeg);
58
54
Angle b = AngleRange (15_stDeg) + 2_stDeg;
59
55
Angle c = 2_stDeg + AngleRange (15_cDeg);
60
- }
61
-
62
- constexpr Number numAssignmentTests () {
63
- using namespace units_double_ops ;
64
- Number n = 1_num; // 1
65
- n += 2 ; // 3
66
- n--; // 2
67
- n -= 3 ; // -1
68
- n *= 2 ; // -2
69
- n /= 2 ; // -1
70
- n++; // 0
71
- return n;
72
- }
73
-
74
- constexpr double doubleAssignmentTests () {
75
- using namespace units_double_ops ;
76
- double d = 1 ; // 1
77
- d += 2_num; // 3
78
- d -= 2_num; // 1
79
- d *= 2_num; // 2
80
- d /= 2_num; // 1
81
- return d;
82
- }
83
-
84
- void numberOperatorTests () {
85
- using namespace units_double_ops ;
86
- static_assert (1_num + 2 == 3 );
87
- static_assert (1 + 2_num <= 3 );
88
- static_assert (1 / 2_num >= 0 );
89
-
90
- static_assert (numAssignmentTests () == 0 );
91
- static_assert (doubleAssignmentTests () == 1 );
92
56
}
0 commit comments