related: tdf#162601 UNIQUE function is case-insensitive also for non ASCII
[LibreOffice.git] / o3tl / qa / test-unit_conversion.cxx
blobd140f1da7ec68aee3404a6acb3558f452570e677
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
12 #include <o3tl/unit_conversion.hxx>
14 // Just some static asserts
16 namespace
18 constexpr double const_abs(double f) { return f >= 0 ? f : -f; }
19 constexpr bool eq(double a, double b) { return const_abs(a - b) < 1E-6; }
20 bool eq(sal_Int64, double) = delete;
23 // testing floating-point conversion
25 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm100, o3tl::Length::mm100), 1));
26 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm10, o3tl::Length::mm100), 10));
27 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm, o3tl::Length::mm100), 100));
28 static_assert(eq(o3tl::convert(1.0, o3tl::Length::cm, o3tl::Length::mm100), 1000));
29 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::mm100), 100000));
30 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::mm100), 100E6));
31 static_assert(eq(o3tl::convert(360.0, o3tl::Length::emu, o3tl::Length::mm100), 1));
32 static_assert(eq(o3tl::convert(72.0, o3tl::Length::twip, o3tl::Length::mm100), 127));
33 static_assert(eq(o3tl::convert(18.0, o3tl::Length::pt, o3tl::Length::mm100), 635));
34 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pc, o3tl::Length::mm100), 1270));
35 static_assert(eq(o3tl::convert(50.0, o3tl::Length::in1000, o3tl::Length::mm100), 127));
36 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in100, o3tl::Length::mm100), 127));
37 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::mm100), 254));
38 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::mm100), 2540));
39 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::mm100), 30480));
40 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::mm100), 160934400));
41 static_assert(eq(o3tl::convert(144.0, o3tl::Length::master, o3tl::Length::mm100), 635));
42 static_assert(eq(o3tl::convert(24.0, o3tl::Length::px, o3tl::Length::mm100), 635));
43 static_assert(eq(o3tl::convert(12.0, o3tl::Length::ch, o3tl::Length::mm100), 4445));
44 static_assert(eq(o3tl::convert(3.0, o3tl::Length::line, o3tl::Length::mm100), 1651));
46 static_assert(eq(o3tl::convert(10.0, o3tl::Length::mm100, o3tl::Length::mm10), 1));
47 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm10, o3tl::Length::mm10), 1));
48 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm, o3tl::Length::mm10), 10));
49 static_assert(eq(o3tl::convert(1.0, o3tl::Length::cm, o3tl::Length::mm10), 100));
50 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::mm10), 10000));
51 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::mm10), 10E6));
52 static_assert(eq(o3tl::convert(3600.0, o3tl::Length::emu, o3tl::Length::mm10), 1));
53 static_assert(eq(o3tl::convert(720.0, o3tl::Length::twip, o3tl::Length::mm10), 127));
54 static_assert(eq(o3tl::convert(36.0, o3tl::Length::pt, o3tl::Length::mm10), 127));
55 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pc, o3tl::Length::mm10), 127));
56 static_assert(eq(o3tl::convert(500.0, o3tl::Length::in1000, o3tl::Length::mm10), 127));
57 static_assert(eq(o3tl::convert(50.0, o3tl::Length::in100, o3tl::Length::mm10), 127));
58 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in10, o3tl::Length::mm10), 127));
59 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::mm10), 254));
60 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::mm10), 3048));
61 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::mm10), 16093440));
62 static_assert(eq(o3tl::convert(288.0, o3tl::Length::master, o3tl::Length::mm10), 127));
63 static_assert(eq(o3tl::convert(48.0, o3tl::Length::px, o3tl::Length::mm10), 127));
64 static_assert(eq(o3tl::convert(24.0, o3tl::Length::ch, o3tl::Length::mm10), 889));
65 static_assert(eq(o3tl::convert(30.0, o3tl::Length::line, o3tl::Length::mm10), 1651));
67 static_assert(eq(o3tl::convert(100.0, o3tl::Length::mm100, o3tl::Length::mm), 1));
68 static_assert(eq(o3tl::convert(10.0, o3tl::Length::mm10, o3tl::Length::mm), 1));
69 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm, o3tl::Length::mm), 1));
70 static_assert(eq(o3tl::convert(1.0, o3tl::Length::cm, o3tl::Length::mm), 10));
71 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::mm), 1000));
72 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::mm), 1E6));
73 static_assert(eq(o3tl::convert(36000.0, o3tl::Length::emu, o3tl::Length::mm), 1));
74 static_assert(eq(o3tl::convert(7200.0, o3tl::Length::twip, o3tl::Length::mm), 127));
75 static_assert(eq(o3tl::convert(360.0, o3tl::Length::pt, o3tl::Length::mm), 127));
76 static_assert(eq(o3tl::convert(30.0, o3tl::Length::pc, o3tl::Length::mm), 127));
77 static_assert(eq(o3tl::convert(5000.0, o3tl::Length::in1000, o3tl::Length::mm), 127));
78 static_assert(eq(o3tl::convert(500.0, o3tl::Length::in100, o3tl::Length::mm), 127));
79 static_assert(eq(o3tl::convert(50.0, o3tl::Length::in10, o3tl::Length::mm), 127));
80 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in, o3tl::Length::mm), 127));
81 static_assert(eq(o3tl::convert(5.0, o3tl::Length::ft, o3tl::Length::mm), 1524));
82 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::mm), 1609344));
83 static_assert(eq(o3tl::convert(2880.0, o3tl::Length::master, o3tl::Length::mm), 127));
84 static_assert(eq(o3tl::convert(480.0, o3tl::Length::px, o3tl::Length::mm), 127));
85 static_assert(eq(o3tl::convert(240.0, o3tl::Length::ch, o3tl::Length::mm), 889));
86 static_assert(eq(o3tl::convert(300.0, o3tl::Length::line, o3tl::Length::mm), 1651));
88 static_assert(eq(o3tl::convert(1000.0, o3tl::Length::mm100, o3tl::Length::cm), 1));
89 static_assert(eq(o3tl::convert(100.0, o3tl::Length::mm10, o3tl::Length::cm), 1));
90 static_assert(eq(o3tl::convert(10.0, o3tl::Length::mm, o3tl::Length::cm), 1));
91 static_assert(eq(o3tl::convert(1.0, o3tl::Length::cm, o3tl::Length::cm), 1));
92 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::cm), 100));
93 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::cm), 100000));
94 static_assert(eq(o3tl::convert(360000.0, o3tl::Length::emu, o3tl::Length::cm), 1));
95 static_assert(eq(o3tl::convert(72000.0, o3tl::Length::twip, o3tl::Length::cm), 127));
96 static_assert(eq(o3tl::convert(3600.0, o3tl::Length::pt, o3tl::Length::cm), 127));
97 static_assert(eq(o3tl::convert(300.0, o3tl::Length::pc, o3tl::Length::cm), 127));
98 static_assert(eq(o3tl::convert(50000.0, o3tl::Length::in1000, o3tl::Length::cm), 127));
99 static_assert(eq(o3tl::convert(5000.0, o3tl::Length::in100, o3tl::Length::cm), 127));
100 static_assert(eq(o3tl::convert(500.0, o3tl::Length::in10, o3tl::Length::cm), 127));
101 static_assert(eq(o3tl::convert(50.0, o3tl::Length::in, o3tl::Length::cm), 127));
102 static_assert(eq(o3tl::convert(25.0, o3tl::Length::ft, o3tl::Length::cm), 762));
103 static_assert(eq(o3tl::convert(5.0, o3tl::Length::mi, o3tl::Length::cm), 804672));
104 static_assert(eq(o3tl::convert(28800.0, o3tl::Length::master, o3tl::Length::cm), 127));
105 static_assert(eq(o3tl::convert(4800.0, o3tl::Length::px, o3tl::Length::cm), 127));
106 static_assert(eq(o3tl::convert(2400.0, o3tl::Length::ch, o3tl::Length::cm), 889));
107 static_assert(eq(o3tl::convert(3000.0, o3tl::Length::line, o3tl::Length::cm), 1651));
109 static_assert(eq(o3tl::convert(100000.0, o3tl::Length::mm100, o3tl::Length::m), 1));
110 static_assert(eq(o3tl::convert(10000.0, o3tl::Length::mm10, o3tl::Length::m), 1));
111 static_assert(eq(o3tl::convert(1000.0, o3tl::Length::mm, o3tl::Length::m), 1));
112 static_assert(eq(o3tl::convert(100.0, o3tl::Length::cm, o3tl::Length::m), 1));
113 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::m), 1));
114 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::m), 1000));
115 static_assert(eq(o3tl::convert(36E6, o3tl::Length::emu, o3tl::Length::m), 1));
116 static_assert(eq(o3tl::convert(7200000.0, o3tl::Length::twip, o3tl::Length::m), 127));
117 static_assert(eq(o3tl::convert(360000.0, o3tl::Length::pt, o3tl::Length::m), 127));
118 static_assert(eq(o3tl::convert(30000.0, o3tl::Length::pc, o3tl::Length::m), 127));
119 static_assert(eq(o3tl::convert(5000000.0, o3tl::Length::in1000, o3tl::Length::m), 127));
120 static_assert(eq(o3tl::convert(500000.0, o3tl::Length::in100, o3tl::Length::m), 127));
121 static_assert(eq(o3tl::convert(50000.0, o3tl::Length::in10, o3tl::Length::m), 127));
122 static_assert(eq(o3tl::convert(5000.0, o3tl::Length::in, o3tl::Length::m), 127));
123 static_assert(eq(o3tl::convert(1250.0, o3tl::Length::ft, o3tl::Length::m), 381));
124 static_assert(eq(o3tl::convert(125.0, o3tl::Length::mi, o3tl::Length::m), 201168));
125 static_assert(eq(o3tl::convert(2880000.0, o3tl::Length::master, o3tl::Length::m), 127));
126 static_assert(eq(o3tl::convert(480000.0, o3tl::Length::px, o3tl::Length::m), 127));
127 static_assert(eq(o3tl::convert(240000.0, o3tl::Length::ch, o3tl::Length::m), 889));
128 static_assert(eq(o3tl::convert(300000.0, o3tl::Length::line, o3tl::Length::m), 1651));
130 static_assert(eq(o3tl::convert(100E6, o3tl::Length::mm100, o3tl::Length::km), 1));
131 static_assert(eq(o3tl::convert(10E6, o3tl::Length::mm10, o3tl::Length::km), 1));
132 static_assert(eq(o3tl::convert(1E6, o3tl::Length::mm, o3tl::Length::km), 1));
133 static_assert(eq(o3tl::convert(100000.0, o3tl::Length::cm, o3tl::Length::km), 1));
134 static_assert(eq(o3tl::convert(1000.0, o3tl::Length::m, o3tl::Length::km), 1));
135 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::km), 1));
136 static_assert(eq(o3tl::convert(36E9, o3tl::Length::emu, o3tl::Length::km), 1));
137 static_assert(eq(o3tl::convert(7200E6, o3tl::Length::twip, o3tl::Length::km), 127));
138 static_assert(eq(o3tl::convert(360E6, o3tl::Length::pt, o3tl::Length::km), 127));
139 static_assert(eq(o3tl::convert(30E6, o3tl::Length::pc, o3tl::Length::km), 127));
140 static_assert(eq(o3tl::convert(5E9, o3tl::Length::in1000, o3tl::Length::km), 127));
141 static_assert(eq(o3tl::convert(500E6, o3tl::Length::in100, o3tl::Length::km), 127));
142 static_assert(eq(o3tl::convert(50E6, o3tl::Length::in10, o3tl::Length::km), 127));
143 static_assert(eq(o3tl::convert(5E6, o3tl::Length::in, o3tl::Length::km), 127));
144 static_assert(eq(o3tl::convert(1250000.0, o3tl::Length::ft, o3tl::Length::km), 381));
145 static_assert(eq(o3tl::convert(15625.0, o3tl::Length::mi, o3tl::Length::km), 25146));
146 static_assert(eq(o3tl::convert(2880E6, o3tl::Length::master, o3tl::Length::km), 127));
147 static_assert(eq(o3tl::convert(480E6, o3tl::Length::px, o3tl::Length::km), 127));
148 static_assert(eq(o3tl::convert(240E6, o3tl::Length::ch, o3tl::Length::km), 889));
149 static_assert(eq(o3tl::convert(300E6, o3tl::Length::line, o3tl::Length::km), 1651));
151 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm100, o3tl::Length::emu), 360));
152 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm10, o3tl::Length::emu), 3600));
153 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mm, o3tl::Length::emu), 36000));
154 static_assert(eq(o3tl::convert(1.0, o3tl::Length::cm, o3tl::Length::emu), 360000));
155 static_assert(eq(o3tl::convert(1.0, o3tl::Length::m, o3tl::Length::emu), 36E6));
156 static_assert(eq(o3tl::convert(1.0, o3tl::Length::km, o3tl::Length::emu), 36E9));
157 static_assert(eq(o3tl::convert(1.0, o3tl::Length::emu, o3tl::Length::emu), 1));
158 static_assert(eq(o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::emu), 635));
159 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pt, o3tl::Length::emu), 12700));
160 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::emu), 152400));
161 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in1000, o3tl::Length::emu), 4572));
162 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in100, o3tl::Length::emu), 9144));
163 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::emu), 91440));
164 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::emu), 914400));
165 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::emu), 10972800));
166 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::emu), 57936384000));
167 static_assert(eq(o3tl::convert(2.0, o3tl::Length::master, o3tl::Length::emu), 3175));
168 static_assert(eq(o3tl::convert(1.0, o3tl::Length::px, o3tl::Length::emu), 9525));
169 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ch, o3tl::Length::emu), 133350));
170 static_assert(eq(o3tl::convert(1.0, o3tl::Length::line, o3tl::Length::emu), 198120));
172 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm100, o3tl::Length::twip), 72));
173 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::twip), 720));
174 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::twip), 7200));
175 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::twip), 72000));
176 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::twip), 7200000));
177 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::twip), 7200E6));
178 static_assert(eq(o3tl::convert(635.0, o3tl::Length::emu, o3tl::Length::twip), 1));
179 static_assert(eq(o3tl::convert(1.0, o3tl::Length::twip, o3tl::Length::twip), 1));
180 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pt, o3tl::Length::twip), 20));
181 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::twip), 240));
182 static_assert(eq(o3tl::convert(25.0, o3tl::Length::in1000, o3tl::Length::twip), 36));
183 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in100, o3tl::Length::twip), 72));
184 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::twip), 144));
185 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::twip), 1440));
186 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::twip), 17280));
187 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::twip), 91238400));
188 static_assert(eq(o3tl::convert(2.0, o3tl::Length::master, o3tl::Length::twip), 5));
189 static_assert(eq(o3tl::convert(1.0, o3tl::Length::px, o3tl::Length::twip), 15));
190 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ch, o3tl::Length::twip), 210));
191 static_assert(eq(o3tl::convert(1.0, o3tl::Length::line, o3tl::Length::twip), 312));
193 static_assert(eq(o3tl::convert(635.0, o3tl::Length::mm100, o3tl::Length::pt), 18));
194 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::pt), 36));
195 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::pt), 360));
196 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::pt), 3600));
197 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::pt), 360000));
198 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::pt), 360E6));
199 static_assert(eq(o3tl::convert(12700.0, o3tl::Length::emu, o3tl::Length::pt), 1));
200 static_assert(eq(o3tl::convert(20.0, o3tl::Length::twip, o3tl::Length::pt), 1));
201 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pt, o3tl::Length::pt), 1));
202 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::pt), 12));
203 static_assert(eq(o3tl::convert(125.0, o3tl::Length::in1000, o3tl::Length::pt), 9));
204 static_assert(eq(o3tl::convert(25.0, o3tl::Length::in100, o3tl::Length::pt), 18));
205 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in10, o3tl::Length::pt), 36));
206 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::pt), 72));
207 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::pt), 864));
208 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::pt), 4561920));
209 static_assert(eq(o3tl::convert(8.0, o3tl::Length::master, o3tl::Length::pt), 1));
210 static_assert(eq(o3tl::convert(4.0, o3tl::Length::px, o3tl::Length::pt), 3));
211 static_assert(eq(o3tl::convert(2.0, o3tl::Length::ch, o3tl::Length::pt), 21));
212 static_assert(eq(o3tl::convert(5.0, o3tl::Length::line, o3tl::Length::pt), 78));
214 static_assert(eq(o3tl::convert(1270.0, o3tl::Length::mm100, o3tl::Length::pc), 3));
215 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::pc), 3));
216 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::pc), 30));
217 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::pc), 300));
218 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::pc), 30000));
219 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::pc), 30E6));
220 static_assert(eq(o3tl::convert(152400.0, o3tl::Length::emu, o3tl::Length::pc), 1));
221 static_assert(eq(o3tl::convert(240.0, o3tl::Length::twip, o3tl::Length::pc), 1));
222 static_assert(eq(o3tl::convert(12.0, o3tl::Length::pt, o3tl::Length::pc), 1));
223 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::pc), 1));
224 static_assert(eq(o3tl::convert(500.0, o3tl::Length::in1000, o3tl::Length::pc), 3));
225 static_assert(eq(o3tl::convert(50.0, o3tl::Length::in100, o3tl::Length::pc), 3));
226 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in10, o3tl::Length::pc), 3));
227 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::pc), 6));
228 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::pc), 72));
229 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::pc), 380160));
230 static_assert(eq(o3tl::convert(96.0, o3tl::Length::master, o3tl::Length::pc), 1));
231 static_assert(eq(o3tl::convert(16.0, o3tl::Length::px, o3tl::Length::pc), 1));
232 static_assert(eq(o3tl::convert(8.0, o3tl::Length::ch, o3tl::Length::pc), 7));
233 static_assert(eq(o3tl::convert(10.0, o3tl::Length::line, o3tl::Length::pc), 13));
235 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm100, o3tl::Length::in1000), 50));
236 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::in1000), 500));
237 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::in1000), 5000));
238 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::in1000), 50000));
239 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::in1000), 5E6));
240 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::in1000), 5E9));
241 static_assert(eq(o3tl::convert(4572.0, o3tl::Length::emu, o3tl::Length::in1000), 5));
242 static_assert(eq(o3tl::convert(36.0, o3tl::Length::twip, o3tl::Length::in1000), 25));
243 static_assert(eq(o3tl::convert(9.0, o3tl::Length::pt, o3tl::Length::in1000), 125));
244 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pc, o3tl::Length::in1000), 500));
245 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in1000, o3tl::Length::in1000), 1));
246 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in100, o3tl::Length::in1000), 10));
247 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::in1000), 100));
248 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::in1000), 1000));
249 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::in1000), 12000));
250 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::in1000), 63360000));
251 static_assert(eq(o3tl::convert(72.0, o3tl::Length::master, o3tl::Length::in1000), 125));
252 static_assert(eq(o3tl::convert(12.0, o3tl::Length::px, o3tl::Length::in1000), 125));
253 static_assert(eq(o3tl::convert(6.0, o3tl::Length::ch, o3tl::Length::in1000), 875));
254 static_assert(eq(o3tl::convert(3.0, o3tl::Length::line, o3tl::Length::in1000), 650));
256 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm100, o3tl::Length::in100), 5));
257 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::in100), 50));
258 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::in100), 500));
259 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::in100), 5000));
260 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::in100), 500000));
261 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::in100), 500E6));
262 static_assert(eq(o3tl::convert(9144.0, o3tl::Length::emu, o3tl::Length::in100), 1));
263 static_assert(eq(o3tl::convert(72.0, o3tl::Length::twip, o3tl::Length::in100), 5));
264 static_assert(eq(o3tl::convert(18.0, o3tl::Length::pt, o3tl::Length::in100), 25));
265 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pc, o3tl::Length::in100), 50));
266 static_assert(eq(o3tl::convert(10.0, o3tl::Length::in1000, o3tl::Length::in100), 1));
267 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in100, o3tl::Length::in100), 1));
268 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::in100), 10));
269 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::in100), 100));
270 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::in100), 1200));
271 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::in100), 6336000));
272 static_assert(eq(o3tl::convert(144.0, o3tl::Length::master, o3tl::Length::in100), 25));
273 static_assert(eq(o3tl::convert(24.0, o3tl::Length::px, o3tl::Length::in100), 25));
274 static_assert(eq(o3tl::convert(12.0, o3tl::Length::ch, o3tl::Length::in100), 175));
275 static_assert(eq(o3tl::convert(3.0, o3tl::Length::line, o3tl::Length::in100), 65));
277 static_assert(eq(o3tl::convert(254.0, o3tl::Length::mm100, o3tl::Length::in10), 1));
278 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::in10), 5));
279 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::in10), 50));
280 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::in10), 500));
281 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::in10), 50000));
282 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::in10), 50E6));
283 static_assert(eq(o3tl::convert(91440.0, o3tl::Length::emu, o3tl::Length::in10), 1));
284 static_assert(eq(o3tl::convert(144.0, o3tl::Length::twip, o3tl::Length::in10), 1));
285 static_assert(eq(o3tl::convert(36.0, o3tl::Length::pt, o3tl::Length::in10), 5));
286 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pc, o3tl::Length::in10), 5));
287 static_assert(eq(o3tl::convert(100.0, o3tl::Length::in1000, o3tl::Length::in10), 1));
288 static_assert(eq(o3tl::convert(10.0, o3tl::Length::in100, o3tl::Length::in10), 1));
289 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in10, o3tl::Length::in10), 1));
290 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::in10), 10));
291 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::in10), 120));
292 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::in10), 633600));
293 static_assert(eq(o3tl::convert(288.0, o3tl::Length::master, o3tl::Length::in10), 5));
294 static_assert(eq(o3tl::convert(48.0, o3tl::Length::px, o3tl::Length::in10), 5));
295 static_assert(eq(o3tl::convert(24.0, o3tl::Length::ch, o3tl::Length::in10), 35));
296 static_assert(eq(o3tl::convert(6.0, o3tl::Length::line, o3tl::Length::in10), 13));
298 static_assert(eq(o3tl::convert(2540.0, o3tl::Length::mm100, o3tl::Length::in), 1));
299 static_assert(eq(o3tl::convert(254.0, o3tl::Length::mm10, o3tl::Length::in), 1));
300 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::in), 5));
301 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::in), 50));
302 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::in), 5000));
303 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::in), 5E6));
304 static_assert(eq(o3tl::convert(914400.0, o3tl::Length::emu, o3tl::Length::in), 1));
305 static_assert(eq(o3tl::convert(1440.0, o3tl::Length::twip, o3tl::Length::in), 1));
306 static_assert(eq(o3tl::convert(72.0, o3tl::Length::pt, o3tl::Length::in), 1));
307 static_assert(eq(o3tl::convert(6.0, o3tl::Length::pc, o3tl::Length::in), 1));
308 static_assert(eq(o3tl::convert(1000.0, o3tl::Length::in1000, o3tl::Length::in), 1));
309 static_assert(eq(o3tl::convert(100.0, o3tl::Length::in100, o3tl::Length::in), 1));
310 static_assert(eq(o3tl::convert(10.0, o3tl::Length::in10, o3tl::Length::in), 1));
311 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::in), 1));
312 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::in), 12));
313 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::in), 63360));
314 static_assert(eq(o3tl::convert(576.0, o3tl::Length::master, o3tl::Length::in), 1));
315 static_assert(eq(o3tl::convert(96.0, o3tl::Length::px, o3tl::Length::in), 1));
316 static_assert(eq(o3tl::convert(48.0, o3tl::Length::ch, o3tl::Length::in), 7));
317 static_assert(eq(o3tl::convert(60.0, o3tl::Length::line, o3tl::Length::in), 13));
319 static_assert(eq(o3tl::convert(30480.0, o3tl::Length::mm100, o3tl::Length::ft), 1));
320 static_assert(eq(o3tl::convert(3048.0, o3tl::Length::mm10, o3tl::Length::ft), 1));
321 static_assert(eq(o3tl::convert(1524.0, o3tl::Length::mm, o3tl::Length::ft), 5));
322 static_assert(eq(o3tl::convert(762.0, o3tl::Length::cm, o3tl::Length::ft), 25));
323 static_assert(eq(o3tl::convert(381.0, o3tl::Length::m, o3tl::Length::ft), 1250));
324 static_assert(eq(o3tl::convert(381.0, o3tl::Length::km, o3tl::Length::ft), 1250000));
325 static_assert(eq(o3tl::convert(10972800.0, o3tl::Length::emu, o3tl::Length::ft), 1));
326 static_assert(eq(o3tl::convert(17280.0, o3tl::Length::twip, o3tl::Length::ft), 1));
327 static_assert(eq(o3tl::convert(864.0, o3tl::Length::pt, o3tl::Length::ft), 1));
328 static_assert(eq(o3tl::convert(72.0, o3tl::Length::pc, o3tl::Length::ft), 1));
329 static_assert(eq(o3tl::convert(12000.0, o3tl::Length::in1000, o3tl::Length::ft), 1));
330 static_assert(eq(o3tl::convert(1200.0, o3tl::Length::in100, o3tl::Length::ft), 1));
331 static_assert(eq(o3tl::convert(120.0, o3tl::Length::in10, o3tl::Length::ft), 1));
332 static_assert(eq(o3tl::convert(12.0, o3tl::Length::in, o3tl::Length::ft), 1));
333 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::ft), 1));
334 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::ft), 5280));
335 static_assert(eq(o3tl::convert(6912.0, o3tl::Length::master, o3tl::Length::ft), 1));
336 static_assert(eq(o3tl::convert(1152.0, o3tl::Length::px, o3tl::Length::ft), 1));
337 static_assert(eq(o3tl::convert(576.0, o3tl::Length::ch, o3tl::Length::ft), 7));
338 static_assert(eq(o3tl::convert(720.0, o3tl::Length::line, o3tl::Length::ft), 13));
340 static_assert(eq(o3tl::convert(160934400.0, o3tl::Length::mm100, o3tl::Length::mi), 1));
341 static_assert(eq(o3tl::convert(16093440.0, o3tl::Length::mm10, o3tl::Length::mi), 1));
342 static_assert(eq(o3tl::convert(1609344.0, o3tl::Length::mm, o3tl::Length::mi), 1));
343 static_assert(eq(o3tl::convert(804672.0, o3tl::Length::cm, o3tl::Length::mi), 5));
344 static_assert(eq(o3tl::convert(201168.0, o3tl::Length::m, o3tl::Length::mi), 125));
345 static_assert(eq(o3tl::convert(25146.0, o3tl::Length::km, o3tl::Length::mi), 15625));
346 static_assert(eq(o3tl::convert(57936384000.0, o3tl::Length::emu, o3tl::Length::mi), 1));
347 static_assert(eq(o3tl::convert(91238400.0, o3tl::Length::twip, o3tl::Length::mi), 1));
348 static_assert(eq(o3tl::convert(4561920.0, o3tl::Length::pt, o3tl::Length::mi), 1));
349 static_assert(eq(o3tl::convert(380160.0, o3tl::Length::pc, o3tl::Length::mi), 1));
350 static_assert(eq(o3tl::convert(63360000.0, o3tl::Length::in1000, o3tl::Length::mi), 1));
351 static_assert(eq(o3tl::convert(6336000.0, o3tl::Length::in100, o3tl::Length::mi), 1));
352 static_assert(eq(o3tl::convert(633600.0, o3tl::Length::in10, o3tl::Length::mi), 1));
353 static_assert(eq(o3tl::convert(63360.0, o3tl::Length::in, o3tl::Length::mi), 1));
354 static_assert(eq(o3tl::convert(5280.0, o3tl::Length::ft, o3tl::Length::mi), 1));
355 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::mi), 1));
356 static_assert(eq(o3tl::convert(36495360.0, o3tl::Length::master, o3tl::Length::mi), 1));
357 static_assert(eq(o3tl::convert(6082560.0, o3tl::Length::px, o3tl::Length::mi), 1));
358 static_assert(eq(o3tl::convert(3041280.0, o3tl::Length::ch, o3tl::Length::mi), 7));
359 static_assert(eq(o3tl::convert(3801600.0, o3tl::Length::line, o3tl::Length::mi), 13));
361 static_assert(eq(o3tl::convert(635.0, o3tl::Length::mm100, o3tl::Length::master), 144));
362 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::master), 288));
363 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::master), 2880));
364 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::master), 28800));
365 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::master), 2880000));
366 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::master), 2880E6));
367 static_assert(eq(o3tl::convert(3175.0, o3tl::Length::emu, o3tl::Length::master), 2));
368 static_assert(eq(o3tl::convert(5.0, o3tl::Length::twip, o3tl::Length::master), 2));
369 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pt, o3tl::Length::master), 8));
370 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::master), 96));
371 static_assert(eq(o3tl::convert(125.0, o3tl::Length::in1000, o3tl::Length::master), 72));
372 static_assert(eq(o3tl::convert(25.0, o3tl::Length::in100, o3tl::Length::master), 144));
373 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in10, o3tl::Length::master), 288));
374 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::master), 576));
375 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::master), 6912));
376 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::master), 36495360));
377 static_assert(eq(o3tl::convert(1.0, o3tl::Length::master, o3tl::Length::master), 1));
378 static_assert(eq(o3tl::convert(1.0, o3tl::Length::px, o3tl::Length::master), 6));
379 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ch, o3tl::Length::master), 84));
380 static_assert(eq(o3tl::convert(5.0, o3tl::Length::line, o3tl::Length::master), 624));
382 static_assert(eq(o3tl::convert(635.0, o3tl::Length::mm100, o3tl::Length::px), 24));
383 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm10, o3tl::Length::px), 48));
384 static_assert(eq(o3tl::convert(127.0, o3tl::Length::mm, o3tl::Length::px), 480));
385 static_assert(eq(o3tl::convert(127.0, o3tl::Length::cm, o3tl::Length::px), 4800));
386 static_assert(eq(o3tl::convert(127.0, o3tl::Length::m, o3tl::Length::px), 480000));
387 static_assert(eq(o3tl::convert(127.0, o3tl::Length::km, o3tl::Length::px), 480E6));
388 static_assert(eq(o3tl::convert(9525.0, o3tl::Length::emu, o3tl::Length::px), 1));
389 static_assert(eq(o3tl::convert(15.0, o3tl::Length::twip, o3tl::Length::px), 1));
390 static_assert(eq(o3tl::convert(3.0, o3tl::Length::pt, o3tl::Length::px), 4));
391 static_assert(eq(o3tl::convert(1.0, o3tl::Length::pc, o3tl::Length::px), 16));
392 static_assert(eq(o3tl::convert(125.0, o3tl::Length::in1000, o3tl::Length::px), 12));
393 static_assert(eq(o3tl::convert(25.0, o3tl::Length::in100, o3tl::Length::px), 24));
394 static_assert(eq(o3tl::convert(5.0, o3tl::Length::in10, o3tl::Length::px), 48));
395 static_assert(eq(o3tl::convert(1.0, o3tl::Length::in, o3tl::Length::px), 96));
396 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ft, o3tl::Length::px), 1152));
397 static_assert(eq(o3tl::convert(1.0, o3tl::Length::mi, o3tl::Length::px), 6082560));
398 static_assert(eq(o3tl::convert(6.0, o3tl::Length::master, o3tl::Length::px), 1));
399 static_assert(eq(o3tl::convert(1.0, o3tl::Length::px, o3tl::Length::px), 1));
400 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ch, o3tl::Length::px), 14));
401 static_assert(eq(o3tl::convert(5.0, o3tl::Length::line, o3tl::Length::px), 104));
403 static_assert(eq(o3tl::convert(4445.0, o3tl::Length::mm100, o3tl::Length::ch), 12));
404 static_assert(eq(o3tl::convert(889.0, o3tl::Length::mm10, o3tl::Length::ch), 24));
405 static_assert(eq(o3tl::convert(889.0, o3tl::Length::mm, o3tl::Length::ch), 240));
406 static_assert(eq(o3tl::convert(889.0, o3tl::Length::cm, o3tl::Length::ch), 2400));
407 static_assert(eq(o3tl::convert(889.0, o3tl::Length::m, o3tl::Length::ch), 240000));
408 static_assert(eq(o3tl::convert(889.0, o3tl::Length::km, o3tl::Length::ch), 240E6));
409 static_assert(eq(o3tl::convert(133350.0, o3tl::Length::emu, o3tl::Length::ch), 1));
410 static_assert(eq(o3tl::convert(210.0, o3tl::Length::twip, o3tl::Length::ch), 1));
411 static_assert(eq(o3tl::convert(21.0, o3tl::Length::pt, o3tl::Length::ch), 2));
412 static_assert(eq(o3tl::convert(7.0, o3tl::Length::pc, o3tl::Length::ch), 8));
413 static_assert(eq(o3tl::convert(875.0, o3tl::Length::in1000, o3tl::Length::ch), 6));
414 static_assert(eq(o3tl::convert(175.0, o3tl::Length::in100, o3tl::Length::ch), 12));
415 static_assert(eq(o3tl::convert(35.0, o3tl::Length::in10, o3tl::Length::ch), 24));
416 static_assert(eq(o3tl::convert(7.0, o3tl::Length::in, o3tl::Length::ch), 48));
417 static_assert(eq(o3tl::convert(7.0, o3tl::Length::ft, o3tl::Length::ch), 576));
418 static_assert(eq(o3tl::convert(7.0, o3tl::Length::mi, o3tl::Length::ch), 3041280));
419 static_assert(eq(o3tl::convert(84.0, o3tl::Length::master, o3tl::Length::ch), 1));
420 static_assert(eq(o3tl::convert(14.0, o3tl::Length::px, o3tl::Length::ch), 1));
421 static_assert(eq(o3tl::convert(1.0, o3tl::Length::ch, o3tl::Length::ch), 1));
422 static_assert(eq(o3tl::convert(35.0, o3tl::Length::line, o3tl::Length::ch), 52));
424 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::mm100, o3tl::Length::line), 3));
425 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::mm10, o3tl::Length::line), 30));
426 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::mm, o3tl::Length::line), 300));
427 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::cm, o3tl::Length::line), 3000));
428 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::m, o3tl::Length::line), 300000));
429 static_assert(eq(o3tl::convert(1651.0, o3tl::Length::km, o3tl::Length::line), 300E6));
430 static_assert(eq(o3tl::convert(198120.0, o3tl::Length::emu, o3tl::Length::line), 1));
431 static_assert(eq(o3tl::convert(312.0, o3tl::Length::twip, o3tl::Length::line), 1));
432 static_assert(eq(o3tl::convert(78.0, o3tl::Length::pt, o3tl::Length::line), 5));
433 static_assert(eq(o3tl::convert(13.0, o3tl::Length::pc, o3tl::Length::line), 10));
434 static_assert(eq(o3tl::convert(650.0, o3tl::Length::in1000, o3tl::Length::line), 3));
435 static_assert(eq(o3tl::convert(65.0, o3tl::Length::in100, o3tl::Length::line), 3));
436 static_assert(eq(o3tl::convert(13.0, o3tl::Length::in10, o3tl::Length::line), 6));
437 static_assert(eq(o3tl::convert(13.0, o3tl::Length::in, o3tl::Length::line), 60));
438 static_assert(eq(o3tl::convert(13.0, o3tl::Length::ft, o3tl::Length::line), 720));
439 static_assert(eq(o3tl::convert(13.0, o3tl::Length::mi, o3tl::Length::line), 3801600));
440 static_assert(eq(o3tl::convert(624.0, o3tl::Length::master, o3tl::Length::line), 5));
441 static_assert(eq(o3tl::convert(104.0, o3tl::Length::px, o3tl::Length::line), 5));
442 static_assert(eq(o3tl::convert(52.0, o3tl::Length::ch, o3tl::Length::line), 35));
443 static_assert(eq(o3tl::convert(1.0, o3tl::Length::line, o3tl::Length::line), 1));
445 // testing integral conversion
447 static_assert(o3tl::convert(100, o3tl::Length::mm100, o3tl::Length::mm100) == 100);
448 static_assert(o3tl::convert(100, o3tl::Length::mm10, o3tl::Length::mm100) == 1000);
449 static_assert(o3tl::convert(100, o3tl::Length::mm, o3tl::Length::mm100) == 10000);
450 static_assert(o3tl::convert(100, o3tl::Length::cm, o3tl::Length::mm100) == 100000);
451 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::mm100) == 10000000);
452 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::mm100) == 10000000000);
453 static_assert(o3tl::convert(36000, o3tl::Length::emu, o3tl::Length::mm100) == 100);
454 static_assert(o3tl::convert(7200, o3tl::Length::twip, o3tl::Length::mm100) == 12700);
455 static_assert(o3tl::convert(1800, o3tl::Length::pt, o3tl::Length::mm100) == 63500);
456 static_assert(o3tl::convert(300, o3tl::Length::pc, o3tl::Length::mm100) == 127000);
457 static_assert(o3tl::convert(5000, o3tl::Length::in1000, o3tl::Length::mm100) == 12700);
458 static_assert(o3tl::convert(500, o3tl::Length::in100, o3tl::Length::mm100) == 12700);
459 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::mm100) == 25400);
460 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::mm100) == 254000);
461 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::mm100) == 3048000);
462 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::mm100) == 16093440000);
463 static_assert(o3tl::convert(14400, o3tl::Length::master, o3tl::Length::mm100) == 63500);
464 static_assert(o3tl::convert(2400, o3tl::Length::px, o3tl::Length::mm100) == 63500);
465 static_assert(o3tl::convert(1200, o3tl::Length::ch, o3tl::Length::mm100) == 444500);
466 static_assert(o3tl::convert(300, o3tl::Length::line, o3tl::Length::mm100) == 165100);
468 static_assert(o3tl::convert(1000, o3tl::Length::mm100, o3tl::Length::mm10) == 100);
469 static_assert(o3tl::convert(100, o3tl::Length::mm10, o3tl::Length::mm10) == 100);
470 static_assert(o3tl::convert(100, o3tl::Length::mm, o3tl::Length::mm10) == 1000);
471 static_assert(o3tl::convert(100, o3tl::Length::cm, o3tl::Length::mm10) == 10000);
472 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::mm10) == 1000000);
473 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::mm10) == 1000000000);
474 static_assert(o3tl::convert(360000, o3tl::Length::emu, o3tl::Length::mm10) == 100);
475 static_assert(o3tl::convert(72000, o3tl::Length::twip, o3tl::Length::mm10) == 12700);
476 static_assert(o3tl::convert(3600, o3tl::Length::pt, o3tl::Length::mm10) == 12700);
477 static_assert(o3tl::convert(300, o3tl::Length::pc, o3tl::Length::mm10) == 12700);
478 static_assert(o3tl::convert(50000, o3tl::Length::in1000, o3tl::Length::mm10) == 12700);
479 static_assert(o3tl::convert(5000, o3tl::Length::in100, o3tl::Length::mm10) == 12700);
480 static_assert(o3tl::convert(500, o3tl::Length::in10, o3tl::Length::mm10) == 12700);
481 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::mm10) == 25400);
482 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::mm10) == 304800);
483 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::mm10) == 1609344000);
484 static_assert(o3tl::convert(28800, o3tl::Length::master, o3tl::Length::mm10) == 12700);
485 static_assert(o3tl::convert(4800, o3tl::Length::px, o3tl::Length::mm10) == 12700);
486 static_assert(o3tl::convert(2400, o3tl::Length::ch, o3tl::Length::mm10) == 88900);
487 static_assert(o3tl::convert(3000, o3tl::Length::line, o3tl::Length::mm10) == 165100);
489 static_assert(o3tl::convert(10000, o3tl::Length::mm100, o3tl::Length::mm) == 100);
490 static_assert(o3tl::convert(1000, o3tl::Length::mm10, o3tl::Length::mm) == 100);
491 static_assert(o3tl::convert(100, o3tl::Length::mm, o3tl::Length::mm) == 100);
492 static_assert(o3tl::convert(100, o3tl::Length::cm, o3tl::Length::mm) == 1000);
493 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::mm) == 100000);
494 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::mm) == 100000000);
495 static_assert(o3tl::convert(3600000, o3tl::Length::emu, o3tl::Length::mm) == 100);
496 static_assert(o3tl::convert(720000, o3tl::Length::twip, o3tl::Length::mm) == 12700);
497 static_assert(o3tl::convert(36000, o3tl::Length::pt, o3tl::Length::mm) == 12700);
498 static_assert(o3tl::convert(3000, o3tl::Length::pc, o3tl::Length::mm) == 12700);
499 static_assert(o3tl::convert(500000, o3tl::Length::in1000, o3tl::Length::mm) == 12700);
500 static_assert(o3tl::convert(50000, o3tl::Length::in100, o3tl::Length::mm) == 12700);
501 static_assert(o3tl::convert(5000, o3tl::Length::in10, o3tl::Length::mm) == 12700);
502 static_assert(o3tl::convert(500, o3tl::Length::in, o3tl::Length::mm) == 12700);
503 static_assert(o3tl::convert(500, o3tl::Length::ft, o3tl::Length::mm) == 152400);
504 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::mm) == 160934400);
505 static_assert(o3tl::convert(288000, o3tl::Length::master, o3tl::Length::mm) == 12700);
506 static_assert(o3tl::convert(48000, o3tl::Length::px, o3tl::Length::mm) == 12700);
507 static_assert(o3tl::convert(24000, o3tl::Length::ch, o3tl::Length::mm) == 88900);
508 static_assert(o3tl::convert(30000, o3tl::Length::line, o3tl::Length::mm) == 165100);
510 static_assert(o3tl::convert(100000, o3tl::Length::mm100, o3tl::Length::cm) == 100);
511 static_assert(o3tl::convert(10000, o3tl::Length::mm10, o3tl::Length::cm) == 100);
512 static_assert(o3tl::convert(1000, o3tl::Length::mm, o3tl::Length::cm) == 100);
513 static_assert(o3tl::convert(100, o3tl::Length::cm, o3tl::Length::cm) == 100);
514 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::cm) == 10000);
515 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::cm) == 10000000);
516 static_assert(o3tl::convert(36000000, o3tl::Length::emu, o3tl::Length::cm) == 100);
517 static_assert(o3tl::convert(7200000, o3tl::Length::twip, o3tl::Length::cm) == 12700);
518 static_assert(o3tl::convert(360000, o3tl::Length::pt, o3tl::Length::cm) == 12700);
519 static_assert(o3tl::convert(30000, o3tl::Length::pc, o3tl::Length::cm) == 12700);
520 static_assert(o3tl::convert(5000000, o3tl::Length::in1000, o3tl::Length::cm) == 12700);
521 static_assert(o3tl::convert(500000, o3tl::Length::in100, o3tl::Length::cm) == 12700);
522 static_assert(o3tl::convert(50000, o3tl::Length::in10, o3tl::Length::cm) == 12700);
523 static_assert(o3tl::convert(5000, o3tl::Length::in, o3tl::Length::cm) == 12700);
524 static_assert(o3tl::convert(2500, o3tl::Length::ft, o3tl::Length::cm) == 76200);
525 static_assert(o3tl::convert(500, o3tl::Length::mi, o3tl::Length::cm) == 80467200);
526 static_assert(o3tl::convert(2880000, o3tl::Length::master, o3tl::Length::cm) == 12700);
527 static_assert(o3tl::convert(480000, o3tl::Length::px, o3tl::Length::cm) == 12700);
528 static_assert(o3tl::convert(240000, o3tl::Length::ch, o3tl::Length::cm) == 88900);
529 static_assert(o3tl::convert(300000, o3tl::Length::line, o3tl::Length::cm) == 165100);
531 static_assert(o3tl::convert(10000000, o3tl::Length::mm100, o3tl::Length::m) == 100);
532 static_assert(o3tl::convert(1000000, o3tl::Length::mm10, o3tl::Length::m) == 100);
533 static_assert(o3tl::convert(100000, o3tl::Length::mm, o3tl::Length::m) == 100);
534 static_assert(o3tl::convert(10000, o3tl::Length::cm, o3tl::Length::m) == 100);
535 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::m) == 100);
536 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::m) == 100000);
537 static_assert(o3tl::convert(3600000000, o3tl::Length::emu, o3tl::Length::m) == 100);
538 static_assert(o3tl::convert(720000000, o3tl::Length::twip, o3tl::Length::m) == 12700);
539 static_assert(o3tl::convert(36000000, o3tl::Length::pt, o3tl::Length::m) == 12700);
540 static_assert(o3tl::convert(3000000, o3tl::Length::pc, o3tl::Length::m) == 12700);
541 static_assert(o3tl::convert(500000000, o3tl::Length::in1000, o3tl::Length::m) == 12700);
542 static_assert(o3tl::convert(50000000, o3tl::Length::in100, o3tl::Length::m) == 12700);
543 static_assert(o3tl::convert(5000000, o3tl::Length::in10, o3tl::Length::m) == 12700);
544 static_assert(o3tl::convert(500000, o3tl::Length::in, o3tl::Length::m) == 12700);
545 static_assert(o3tl::convert(125000, o3tl::Length::ft, o3tl::Length::m) == 38100);
546 static_assert(o3tl::convert(12500, o3tl::Length::mi, o3tl::Length::m) == 20116800);
547 static_assert(o3tl::convert(288000000, o3tl::Length::master, o3tl::Length::m) == 12700);
548 static_assert(o3tl::convert(48000000, o3tl::Length::px, o3tl::Length::m) == 12700);
549 static_assert(o3tl::convert(24000000, o3tl::Length::ch, o3tl::Length::m) == 88900);
550 static_assert(o3tl::convert(30000000, o3tl::Length::line, o3tl::Length::m) == 165100);
552 static_assert(o3tl::convert(10000000000, o3tl::Length::mm100, o3tl::Length::km) == 100);
553 static_assert(o3tl::convert(1000000000, o3tl::Length::mm10, o3tl::Length::km) == 100);
554 static_assert(o3tl::convert(100000000, o3tl::Length::mm, o3tl::Length::km) == 100);
555 static_assert(o3tl::convert(10000000, o3tl::Length::cm, o3tl::Length::km) == 100);
556 static_assert(o3tl::convert(100000, o3tl::Length::m, o3tl::Length::km) == 100);
557 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::km) == 100);
558 static_assert(o3tl::convert(3600000000000, o3tl::Length::emu, o3tl::Length::km) == 100);
559 static_assert(o3tl::convert(720000000000, o3tl::Length::twip, o3tl::Length::km) == 12700);
560 static_assert(o3tl::convert(36000000000, o3tl::Length::pt, o3tl::Length::km) == 12700);
561 static_assert(o3tl::convert(3000000000, o3tl::Length::pc, o3tl::Length::km) == 12700);
562 static_assert(o3tl::convert(500000000000, o3tl::Length::in1000, o3tl::Length::km) == 12700);
563 static_assert(o3tl::convert(50000000000, o3tl::Length::in100, o3tl::Length::km) == 12700);
564 static_assert(o3tl::convert(5000000000, o3tl::Length::in10, o3tl::Length::km) == 12700);
565 static_assert(o3tl::convert(500000000, o3tl::Length::in, o3tl::Length::km) == 12700);
566 static_assert(o3tl::convert(125000000, o3tl::Length::ft, o3tl::Length::km) == 38100);
567 static_assert(o3tl::convert(1562500, o3tl::Length::mi, o3tl::Length::km) == 2514600);
568 static_assert(o3tl::convert(288000000000, o3tl::Length::master, o3tl::Length::km) == 12700);
569 static_assert(o3tl::convert(48000000000, o3tl::Length::px, o3tl::Length::km) == 12700);
570 static_assert(o3tl::convert(24000000000, o3tl::Length::ch, o3tl::Length::km) == 88900);
571 static_assert(o3tl::convert(30000000000, o3tl::Length::line, o3tl::Length::km) == 165100);
573 static_assert(o3tl::convert(100, o3tl::Length::mm100, o3tl::Length::emu) == 36000);
574 static_assert(o3tl::convert(100, o3tl::Length::mm10, o3tl::Length::emu) == 360000);
575 static_assert(o3tl::convert(100, o3tl::Length::mm, o3tl::Length::emu) == 3600000);
576 static_assert(o3tl::convert(100, o3tl::Length::cm, o3tl::Length::emu) == 36000000);
577 static_assert(o3tl::convert(100, o3tl::Length::m, o3tl::Length::emu) == 3600000000);
578 static_assert(o3tl::convert(100, o3tl::Length::km, o3tl::Length::emu) == 3600000000000);
579 static_assert(o3tl::convert(100, o3tl::Length::emu, o3tl::Length::emu) == 100);
580 static_assert(o3tl::convert(100, o3tl::Length::twip, o3tl::Length::emu) == 63500);
581 static_assert(o3tl::convert(100, o3tl::Length::pt, o3tl::Length::emu) == 1270000);
582 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::emu) == 15240000);
583 static_assert(o3tl::convert(500, o3tl::Length::in1000, o3tl::Length::emu) == 457200);
584 static_assert(o3tl::convert(100, o3tl::Length::in100, o3tl::Length::emu) == 914400);
585 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::emu) == 9144000);
586 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::emu) == 91440000);
587 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::emu) == 1097280000);
588 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::emu) == 5793638400000);
589 static_assert(o3tl::convert(200, o3tl::Length::master, o3tl::Length::emu) == 317500);
590 static_assert(o3tl::convert(100, o3tl::Length::px, o3tl::Length::emu) == 952500);
591 static_assert(o3tl::convert(100, o3tl::Length::ch, o3tl::Length::emu) == 13335000);
592 static_assert(o3tl::convert(100, o3tl::Length::line, o3tl::Length::emu) == 19812000);
594 static_assert(o3tl::convert(12700, o3tl::Length::mm100, o3tl::Length::twip) == 7200);
595 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::twip) == 72000);
596 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::twip) == 720000);
597 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::twip) == 7200000);
598 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::twip) == 720000000);
599 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::twip) == 720000000000);
600 static_assert(o3tl::convert(63500, o3tl::Length::emu, o3tl::Length::twip) == 100);
601 static_assert(o3tl::convert(100, o3tl::Length::twip, o3tl::Length::twip) == 100);
602 static_assert(o3tl::convert(100, o3tl::Length::pt, o3tl::Length::twip) == 2000);
603 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::twip) == 24000);
604 static_assert(o3tl::convert(2500, o3tl::Length::in1000, o3tl::Length::twip) == 3600);
605 static_assert(o3tl::convert(500, o3tl::Length::in100, o3tl::Length::twip) == 7200);
606 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::twip) == 14400);
607 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::twip) == 144000);
608 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::twip) == 1728000);
609 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::twip) == 9123840000);
610 static_assert(o3tl::convert(200, o3tl::Length::master, o3tl::Length::twip) == 500);
611 static_assert(o3tl::convert(100, o3tl::Length::px, o3tl::Length::twip) == 1500);
612 static_assert(o3tl::convert(100, o3tl::Length::ch, o3tl::Length::twip) == 21000);
613 static_assert(o3tl::convert(100, o3tl::Length::line, o3tl::Length::twip) == 31200);
615 static_assert(o3tl::convert(63500, o3tl::Length::mm100, o3tl::Length::pt) == 1800);
616 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::pt) == 3600);
617 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::pt) == 36000);
618 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::pt) == 360000);
619 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::pt) == 36000000);
620 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::pt) == 36000000000);
621 static_assert(o3tl::convert(1270000, o3tl::Length::emu, o3tl::Length::pt) == 100);
622 static_assert(o3tl::convert(2000, o3tl::Length::twip, o3tl::Length::pt) == 100);
623 static_assert(o3tl::convert(100, o3tl::Length::pt, o3tl::Length::pt) == 100);
624 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::pt) == 1200);
625 static_assert(o3tl::convert(12500, o3tl::Length::in1000, o3tl::Length::pt) == 900);
626 static_assert(o3tl::convert(2500, o3tl::Length::in100, o3tl::Length::pt) == 1800);
627 static_assert(o3tl::convert(500, o3tl::Length::in10, o3tl::Length::pt) == 3600);
628 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::pt) == 7200);
629 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::pt) == 86400);
630 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::pt) == 456192000);
631 static_assert(o3tl::convert(800, o3tl::Length::master, o3tl::Length::pt) == 100);
632 static_assert(o3tl::convert(400, o3tl::Length::px, o3tl::Length::pt) == 300);
633 static_assert(o3tl::convert(200, o3tl::Length::ch, o3tl::Length::pt) == 2100);
634 static_assert(o3tl::convert(500, o3tl::Length::line, o3tl::Length::pt) == 7800);
636 static_assert(o3tl::convert(127000, o3tl::Length::mm100, o3tl::Length::pc) == 300);
637 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::pc) == 300);
638 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::pc) == 3000);
639 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::pc) == 30000);
640 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::pc) == 3000000);
641 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::pc) == 3000000000);
642 static_assert(o3tl::convert(15240000, o3tl::Length::emu, o3tl::Length::pc) == 100);
643 static_assert(o3tl::convert(24000, o3tl::Length::twip, o3tl::Length::pc) == 100);
644 static_assert(o3tl::convert(1200, o3tl::Length::pt, o3tl::Length::pc) == 100);
645 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::pc) == 100);
646 static_assert(o3tl::convert(50000, o3tl::Length::in1000, o3tl::Length::pc) == 300);
647 static_assert(o3tl::convert(5000, o3tl::Length::in100, o3tl::Length::pc) == 300);
648 static_assert(o3tl::convert(500, o3tl::Length::in10, o3tl::Length::pc) == 300);
649 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::pc) == 600);
650 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::pc) == 7200);
651 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::pc) == 38016000);
652 static_assert(o3tl::convert(9600, o3tl::Length::master, o3tl::Length::pc) == 100);
653 static_assert(o3tl::convert(1600, o3tl::Length::px, o3tl::Length::pc) == 100);
654 static_assert(o3tl::convert(800, o3tl::Length::ch, o3tl::Length::pc) == 700);
655 static_assert(o3tl::convert(1000, o3tl::Length::line, o3tl::Length::pc) == 1300);
657 static_assert(o3tl::convert(12700, o3tl::Length::mm100, o3tl::Length::in1000) == 5000);
658 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::in1000) == 50000);
659 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::in1000) == 500000);
660 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::in1000) == 5000000);
661 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::in1000) == 500000000);
662 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::in1000) == 500000000000);
663 static_assert(o3tl::convert(457200, o3tl::Length::emu, o3tl::Length::in1000) == 500);
664 static_assert(o3tl::convert(3600, o3tl::Length::twip, o3tl::Length::in1000) == 2500);
665 static_assert(o3tl::convert(900, o3tl::Length::pt, o3tl::Length::in1000) == 12500);
666 static_assert(o3tl::convert(300, o3tl::Length::pc, o3tl::Length::in1000) == 50000);
667 static_assert(o3tl::convert(100, o3tl::Length::in1000, o3tl::Length::in1000) == 100);
668 static_assert(o3tl::convert(100, o3tl::Length::in100, o3tl::Length::in1000) == 1000);
669 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::in1000) == 10000);
670 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::in1000) == 100000);
671 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::in1000) == 1200000);
672 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::in1000) == 6336000000);
673 static_assert(o3tl::convert(7200, o3tl::Length::master, o3tl::Length::in1000) == 12500);
674 static_assert(o3tl::convert(1200, o3tl::Length::px, o3tl::Length::in1000) == 12500);
675 static_assert(o3tl::convert(600, o3tl::Length::ch, o3tl::Length::in1000) == 87500);
676 static_assert(o3tl::convert(300, o3tl::Length::line, o3tl::Length::in1000) == 65000);
678 static_assert(o3tl::convert(12700, o3tl::Length::mm100, o3tl::Length::in100) == 500);
679 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::in100) == 5000);
680 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::in100) == 50000);
681 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::in100) == 500000);
682 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::in100) == 50000000);
683 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::in100) == 50000000000);
684 static_assert(o3tl::convert(914400, o3tl::Length::emu, o3tl::Length::in100) == 100);
685 static_assert(o3tl::convert(7200, o3tl::Length::twip, o3tl::Length::in100) == 500);
686 static_assert(o3tl::convert(1800, o3tl::Length::pt, o3tl::Length::in100) == 2500);
687 static_assert(o3tl::convert(300, o3tl::Length::pc, o3tl::Length::in100) == 5000);
688 static_assert(o3tl::convert(1000, o3tl::Length::in1000, o3tl::Length::in100) == 100);
689 static_assert(o3tl::convert(100, o3tl::Length::in100, o3tl::Length::in100) == 100);
690 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::in100) == 1000);
691 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::in100) == 10000);
692 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::in100) == 120000);
693 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::in100) == 633600000);
694 static_assert(o3tl::convert(14400, o3tl::Length::master, o3tl::Length::in100) == 2500);
695 static_assert(o3tl::convert(2400, o3tl::Length::px, o3tl::Length::in100) == 2500);
696 static_assert(o3tl::convert(1200, o3tl::Length::ch, o3tl::Length::in100) == 17500);
697 static_assert(o3tl::convert(300, o3tl::Length::line, o3tl::Length::in100) == 6500);
699 static_assert(o3tl::convert(25400, o3tl::Length::mm100, o3tl::Length::in10) == 100);
700 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::in10) == 500);
701 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::in10) == 5000);
702 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::in10) == 50000);
703 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::in10) == 5000000);
704 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::in10) == 5000000000);
705 static_assert(o3tl::convert(9144000, o3tl::Length::emu, o3tl::Length::in10) == 100);
706 static_assert(o3tl::convert(14400, o3tl::Length::twip, o3tl::Length::in10) == 100);
707 static_assert(o3tl::convert(3600, o3tl::Length::pt, o3tl::Length::in10) == 500);
708 static_assert(o3tl::convert(300, o3tl::Length::pc, o3tl::Length::in10) == 500);
709 static_assert(o3tl::convert(10000, o3tl::Length::in1000, o3tl::Length::in10) == 100);
710 static_assert(o3tl::convert(1000, o3tl::Length::in100, o3tl::Length::in10) == 100);
711 static_assert(o3tl::convert(100, o3tl::Length::in10, o3tl::Length::in10) == 100);
712 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::in10) == 1000);
713 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::in10) == 12000);
714 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::in10) == 63360000);
715 static_assert(o3tl::convert(28800, o3tl::Length::master, o3tl::Length::in10) == 500);
716 static_assert(o3tl::convert(4800, o3tl::Length::px, o3tl::Length::in10) == 500);
717 static_assert(o3tl::convert(2400, o3tl::Length::ch, o3tl::Length::in10) == 3500);
718 static_assert(o3tl::convert(600, o3tl::Length::line, o3tl::Length::in10) == 1300);
720 static_assert(o3tl::convert(254000, o3tl::Length::mm100, o3tl::Length::in) == 100);
721 static_assert(o3tl::convert(25400, o3tl::Length::mm10, o3tl::Length::in) == 100);
722 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::in) == 500);
723 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::in) == 5000);
724 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::in) == 500000);
725 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::in) == 500000000);
726 static_assert(o3tl::convert(91440000, o3tl::Length::emu, o3tl::Length::in) == 100);
727 static_assert(o3tl::convert(144000, o3tl::Length::twip, o3tl::Length::in) == 100);
728 static_assert(o3tl::convert(7200, o3tl::Length::pt, o3tl::Length::in) == 100);
729 static_assert(o3tl::convert(600, o3tl::Length::pc, o3tl::Length::in) == 100);
730 static_assert(o3tl::convert(100000, o3tl::Length::in1000, o3tl::Length::in) == 100);
731 static_assert(o3tl::convert(10000, o3tl::Length::in100, o3tl::Length::in) == 100);
732 static_assert(o3tl::convert(1000, o3tl::Length::in10, o3tl::Length::in) == 100);
733 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::in) == 100);
734 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::in) == 1200);
735 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::in) == 6336000);
736 static_assert(o3tl::convert(57600, o3tl::Length::master, o3tl::Length::in) == 100);
737 static_assert(o3tl::convert(9600, o3tl::Length::px, o3tl::Length::in) == 100);
738 static_assert(o3tl::convert(4800, o3tl::Length::ch, o3tl::Length::in) == 700);
739 static_assert(o3tl::convert(6000, o3tl::Length::line, o3tl::Length::in) == 1300);
741 static_assert(o3tl::convert(3048000, o3tl::Length::mm100, o3tl::Length::ft) == 100);
742 static_assert(o3tl::convert(304800, o3tl::Length::mm10, o3tl::Length::ft) == 100);
743 static_assert(o3tl::convert(152400, o3tl::Length::mm, o3tl::Length::ft) == 500);
744 static_assert(o3tl::convert(76200, o3tl::Length::cm, o3tl::Length::ft) == 2500);
745 static_assert(o3tl::convert(38100, o3tl::Length::m, o3tl::Length::ft) == 125000);
746 static_assert(o3tl::convert(38100, o3tl::Length::km, o3tl::Length::ft) == 125000000);
747 static_assert(o3tl::convert(1097280000, o3tl::Length::emu, o3tl::Length::ft) == 100);
748 static_assert(o3tl::convert(1728000, o3tl::Length::twip, o3tl::Length::ft) == 100);
749 static_assert(o3tl::convert(86400, o3tl::Length::pt, o3tl::Length::ft) == 100);
750 static_assert(o3tl::convert(7200, o3tl::Length::pc, o3tl::Length::ft) == 100);
751 static_assert(o3tl::convert(1200000, o3tl::Length::in1000, o3tl::Length::ft) == 100);
752 static_assert(o3tl::convert(120000, o3tl::Length::in100, o3tl::Length::ft) == 100);
753 static_assert(o3tl::convert(12000, o3tl::Length::in10, o3tl::Length::ft) == 100);
754 static_assert(o3tl::convert(1200, o3tl::Length::in, o3tl::Length::ft) == 100);
755 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::ft) == 100);
756 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::ft) == 528000);
757 static_assert(o3tl::convert(691200, o3tl::Length::master, o3tl::Length::ft) == 100);
758 static_assert(o3tl::convert(115200, o3tl::Length::px, o3tl::Length::ft) == 100);
759 static_assert(o3tl::convert(57600, o3tl::Length::ch, o3tl::Length::ft) == 700);
760 static_assert(o3tl::convert(72000, o3tl::Length::line, o3tl::Length::ft) == 1300);
762 static_assert(o3tl::convert(16093440000, o3tl::Length::mm100, o3tl::Length::mi) == 100);
763 static_assert(o3tl::convert(1609344000, o3tl::Length::mm10, o3tl::Length::mi) == 100);
764 static_assert(o3tl::convert(160934400, o3tl::Length::mm, o3tl::Length::mi) == 100);
765 static_assert(o3tl::convert(80467200, o3tl::Length::cm, o3tl::Length::mi) == 500);
766 static_assert(o3tl::convert(20116800, o3tl::Length::m, o3tl::Length::mi) == 12500);
767 static_assert(o3tl::convert(2514600, o3tl::Length::km, o3tl::Length::mi) == 1562500);
768 static_assert(o3tl::convert(5793638400000, o3tl::Length::emu, o3tl::Length::mi) == 100);
769 static_assert(o3tl::convert(9123840000, o3tl::Length::twip, o3tl::Length::mi) == 100);
770 static_assert(o3tl::convert(456192000, o3tl::Length::pt, o3tl::Length::mi) == 100);
771 static_assert(o3tl::convert(38016000, o3tl::Length::pc, o3tl::Length::mi) == 100);
772 static_assert(o3tl::convert(6336000000, o3tl::Length::in1000, o3tl::Length::mi) == 100);
773 static_assert(o3tl::convert(633600000, o3tl::Length::in100, o3tl::Length::mi) == 100);
774 static_assert(o3tl::convert(63360000, o3tl::Length::in10, o3tl::Length::mi) == 100);
775 static_assert(o3tl::convert(6336000, o3tl::Length::in, o3tl::Length::mi) == 100);
776 static_assert(o3tl::convert(528000, o3tl::Length::ft, o3tl::Length::mi) == 100);
777 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::mi) == 100);
778 static_assert(o3tl::convert(3649536000, o3tl::Length::master, o3tl::Length::mi) == 100);
779 static_assert(o3tl::convert(608256000, o3tl::Length::px, o3tl::Length::mi) == 100);
780 static_assert(o3tl::convert(304128000, o3tl::Length::ch, o3tl::Length::mi) == 700);
781 static_assert(o3tl::convert(380160000, o3tl::Length::line, o3tl::Length::mi) == 1300);
783 static_assert(o3tl::convert(63500, o3tl::Length::mm100, o3tl::Length::master) == 14400);
784 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::master) == 28800);
785 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::master) == 288000);
786 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::master) == 2880000);
787 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::master) == 288000000);
788 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::master) == 288000000000);
789 static_assert(o3tl::convert(317500, o3tl::Length::emu, o3tl::Length::master) == 200);
790 static_assert(o3tl::convert(500, o3tl::Length::twip, o3tl::Length::master) == 200);
791 static_assert(o3tl::convert(100, o3tl::Length::pt, o3tl::Length::master) == 800);
792 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::master) == 9600);
793 static_assert(o3tl::convert(12500, o3tl::Length::in1000, o3tl::Length::master) == 7200);
794 static_assert(o3tl::convert(2500, o3tl::Length::in100, o3tl::Length::master) == 14400);
795 static_assert(o3tl::convert(500, o3tl::Length::in10, o3tl::Length::master) == 28800);
796 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::master) == 57600);
797 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::master) == 691200);
798 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::master) == 3649536000);
799 static_assert(o3tl::convert(100, o3tl::Length::master, o3tl::Length::master) == 100);
800 static_assert(o3tl::convert(100, o3tl::Length::px, o3tl::Length::master) == 600);
801 static_assert(o3tl::convert(100, o3tl::Length::ch, o3tl::Length::master) == 8400);
802 static_assert(o3tl::convert(500, o3tl::Length::line, o3tl::Length::master) == 62400);
804 static_assert(o3tl::convert(63500, o3tl::Length::mm100, o3tl::Length::px) == 2400);
805 static_assert(o3tl::convert(12700, o3tl::Length::mm10, o3tl::Length::px) == 4800);
806 static_assert(o3tl::convert(12700, o3tl::Length::mm, o3tl::Length::px) == 48000);
807 static_assert(o3tl::convert(12700, o3tl::Length::cm, o3tl::Length::px) == 480000);
808 static_assert(o3tl::convert(12700, o3tl::Length::m, o3tl::Length::px) == 48000000);
809 static_assert(o3tl::convert(12700, o3tl::Length::km, o3tl::Length::px) == 48000000000);
810 static_assert(o3tl::convert(952500, o3tl::Length::emu, o3tl::Length::px) == 100);
811 static_assert(o3tl::convert(1500, o3tl::Length::twip, o3tl::Length::px) == 100);
812 static_assert(o3tl::convert(300, o3tl::Length::pt, o3tl::Length::px) == 400);
813 static_assert(o3tl::convert(100, o3tl::Length::pc, o3tl::Length::px) == 1600);
814 static_assert(o3tl::convert(12500, o3tl::Length::in1000, o3tl::Length::px) == 1200);
815 static_assert(o3tl::convert(2500, o3tl::Length::in100, o3tl::Length::px) == 2400);
816 static_assert(o3tl::convert(500, o3tl::Length::in10, o3tl::Length::px) == 4800);
817 static_assert(o3tl::convert(100, o3tl::Length::in, o3tl::Length::px) == 9600);
818 static_assert(o3tl::convert(100, o3tl::Length::ft, o3tl::Length::px) == 115200);
819 static_assert(o3tl::convert(100, o3tl::Length::mi, o3tl::Length::px) == 608256000);
820 static_assert(o3tl::convert(600, o3tl::Length::master, o3tl::Length::px) == 100);
821 static_assert(o3tl::convert(100, o3tl::Length::px, o3tl::Length::px) == 100);
822 static_assert(o3tl::convert(100, o3tl::Length::ch, o3tl::Length::px) == 1400);
823 static_assert(o3tl::convert(500, o3tl::Length::line, o3tl::Length::px) == 10400);
825 static_assert(o3tl::convert(444500, o3tl::Length::mm100, o3tl::Length::ch) == 1200);
826 static_assert(o3tl::convert(88900, o3tl::Length::mm10, o3tl::Length::ch) == 2400);
827 static_assert(o3tl::convert(88900, o3tl::Length::mm, o3tl::Length::ch) == 24000);
828 static_assert(o3tl::convert(88900, o3tl::Length::cm, o3tl::Length::ch) == 240000);
829 static_assert(o3tl::convert(88900, o3tl::Length::m, o3tl::Length::ch) == 24000000);
830 static_assert(o3tl::convert(88900, o3tl::Length::km, o3tl::Length::ch) == 24000000000);
831 static_assert(o3tl::convert(13335000, o3tl::Length::emu, o3tl::Length::ch) == 100);
832 static_assert(o3tl::convert(21000, o3tl::Length::twip, o3tl::Length::ch) == 100);
833 static_assert(o3tl::convert(2100, o3tl::Length::pt, o3tl::Length::ch) == 200);
834 static_assert(o3tl::convert(700, o3tl::Length::pc, o3tl::Length::ch) == 800);
835 static_assert(o3tl::convert(87500, o3tl::Length::in1000, o3tl::Length::ch) == 600);
836 static_assert(o3tl::convert(17500, o3tl::Length::in100, o3tl::Length::ch) == 1200);
837 static_assert(o3tl::convert(3500, o3tl::Length::in10, o3tl::Length::ch) == 2400);
838 static_assert(o3tl::convert(700, o3tl::Length::in, o3tl::Length::ch) == 4800);
839 static_assert(o3tl::convert(700, o3tl::Length::ft, o3tl::Length::ch) == 57600);
840 static_assert(o3tl::convert(700, o3tl::Length::mi, o3tl::Length::ch) == 304128000);
841 static_assert(o3tl::convert(8400, o3tl::Length::master, o3tl::Length::ch) == 100);
842 static_assert(o3tl::convert(1400, o3tl::Length::px, o3tl::Length::ch) == 100);
843 static_assert(o3tl::convert(100, o3tl::Length::ch, o3tl::Length::ch) == 100);
844 static_assert(o3tl::convert(3500, o3tl::Length::line, o3tl::Length::ch) == 5200);
846 static_assert(o3tl::convert(165100, o3tl::Length::mm100, o3tl::Length::line) == 300);
847 static_assert(o3tl::convert(165100, o3tl::Length::mm10, o3tl::Length::line) == 3000);
848 static_assert(o3tl::convert(165100, o3tl::Length::mm, o3tl::Length::line) == 30000);
849 static_assert(o3tl::convert(165100, o3tl::Length::cm, o3tl::Length::line) == 300000);
850 static_assert(o3tl::convert(165100, o3tl::Length::m, o3tl::Length::line) == 30000000);
851 static_assert(o3tl::convert(165100, o3tl::Length::km, o3tl::Length::line) == 30000000000);
852 static_assert(o3tl::convert(19812000, o3tl::Length::emu, o3tl::Length::line) == 100);
853 static_assert(o3tl::convert(31200, o3tl::Length::twip, o3tl::Length::line) == 100);
854 static_assert(o3tl::convert(7800, o3tl::Length::pt, o3tl::Length::line) == 500);
855 static_assert(o3tl::convert(1300, o3tl::Length::pc, o3tl::Length::line) == 1000);
856 static_assert(o3tl::convert(65000, o3tl::Length::in1000, o3tl::Length::line) == 300);
857 static_assert(o3tl::convert(6500, o3tl::Length::in100, o3tl::Length::line) == 300);
858 static_assert(o3tl::convert(1300, o3tl::Length::in10, o3tl::Length::line) == 600);
859 static_assert(o3tl::convert(1300, o3tl::Length::in, o3tl::Length::line) == 6000);
860 static_assert(o3tl::convert(1300, o3tl::Length::ft, o3tl::Length::line) == 72000);
861 static_assert(o3tl::convert(1300, o3tl::Length::mi, o3tl::Length::line) == 380160000);
862 static_assert(o3tl::convert(62400, o3tl::Length::master, o3tl::Length::line) == 500);
863 static_assert(o3tl::convert(10400, o3tl::Length::px, o3tl::Length::line) == 500);
864 static_assert(o3tl::convert(5200, o3tl::Length::ch, o3tl::Length::line) == 3500);
865 static_assert(o3tl::convert(100, o3tl::Length::line, o3tl::Length::line) == 100);
867 // Integral rounding
869 static_assert(o3tl::convert(49, o3tl::Length::mm100, o3tl::Length::mm) == 0);
870 static_assert(o3tl::convert(50, o3tl::Length::mm100, o3tl::Length::mm) == 1);
872 // Conversions used in the code - to make sure they produce the expected and unchanged result
874 static_assert(o3tl::toTwips(25, o3tl::Length::in100) == 1440 / 4);
875 static_assert(o3tl::toTwips(15, o3tl::Length::in100) == 216);
876 // the following twip value used to the constant for 20mm
877 static_assert(o3tl::toTwips(20, o3tl::Length::mm) == 1134);
878 // 847 100thmm used to represent 24pt
879 static_assert(o3tl::convert(24, o3tl::Length::pt, o3tl::Length::mm100) == 847);
881 static_assert(o3tl::convertSaturate(SAL_MAX_INT64, 72, 127) == 5228998320106644552); // no overflow
883 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */