summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2013-04-21 21:51:17 -0600
committerMike Buland <mike@xagasoft.com>2013-04-21 21:51:17 -0600
commita520fc5740da7d50a289357e4e6e529b826454e7 (patch)
treeb54cbe7d8e33e262e87697425f08b77446f75aa5 /src/main.cpp
parent7b87784eaf497a976b56be4fd169fb52c9bf7dea (diff)
downloadclic-a520fc5740da7d50a289357e4e6e529b826454e7.tar.gz
clic-a520fc5740da7d50a289357e4e6e529b826454e7.tar.bz2
clic-a520fc5740da7d50a289357e4e6e529b826454e7.tar.xz
clic-a520fc5740da7d50a289357e4e6e529b826454e7.zip
FIxed fractional support in comparisons.
They still don't handle mixed scale comparisons correctly, it shouldn't be too hard to add, but yeah...not supported yet.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5e420f5..d1b9d1c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -194,6 +194,66 @@ void numbertestcomp()
194 compcheck( -123, <=, -122 ); 194 compcheck( -123, <=, -122 );
195 compcheck( -122, <=, -123 ); 195 compcheck( -122, <=, -123 );
196 compcheck( 123, <=, -122 ); 196 compcheck( 123, <=, -122 );
197
198 println("-==-==- Non-Integer Test -==-==-");
199
200 a.setScale( 8 );
201 b.setScale( 8 );
202 println("-==- Greater Than -==-");
203 compcheck( 10.1, >, 10.4 );
204 compcheck( 10.1, >, 10.1 );
205 compcheck( 10.4, >, 10.1 );
206 compcheck( 10.413, >, 10.413 );
207 compcheck( 10.41329135, >, 10.41329134 );
208 compcheck( 10.41329134, >, 10.41329135 );
209 compcheck( 10.41329135, >, 10.41329135 );
210 compcheck( -123.3, >, 123.2 );
211 compcheck( -123.3, >, -123.2 );
212 compcheck( -123.3, >, -123.3 );
213 compcheck( -123.3, >, -123.2 );
214 compcheck( 123.3, >, -123.2 );
215
216 println("-==- Less Than -==-");
217 compcheck( 10.1, <, 10.4 );
218 compcheck( 10.1, <, 10.1 );
219 compcheck( 10.4, <, 10.1 );
220 compcheck( 10.413, <, 10.413 );
221 compcheck( 10.41329135, <, 10.41329134 );
222 compcheck( 10.41329134, <, 10.41329135 );
223 compcheck( 10.41329135, <, 10.41329135 );
224 compcheck( -123.3, <, 123.2 );
225 compcheck( -123.3, <, -123.2 );
226 compcheck( -123.3, <, -123.3 );
227 compcheck( -123.3, <, -123.2 );
228 compcheck( 123.3, <, -123.2 );
229
230 println("-==- Greater Than or Equal To -==-");
231 compcheck( 10.1, >=, 10.4 );
232 compcheck( 10.1, >=, 10.1 );
233 compcheck( 10.4, >=, 10.1 );
234 compcheck( 10.413, >=, 10.413 );
235 compcheck( 10.41329135, >=, 10.41329134 );
236 compcheck( 10.41329134, >=, 10.41329135 );
237 compcheck( 10.41329135, >=, 10.41329135 );
238 compcheck( -123.3, >=, 123.2 );
239 compcheck( -123.3, >=, -123.2 );
240 compcheck( -123.3, >=, -123.3 );
241 compcheck( -123.3, >=, -123.2 );
242 compcheck( 123.3, >=, -123.2 );
243
244 println("-==- Less Than or Equal To -==-");
245 compcheck( 10.1, <=, 10.4 );
246 compcheck( 10.1, <=, 10.1 );
247 compcheck( 10.4, <=, 10.1 );
248 compcheck( 10.413, <=, 10.413 );
249 compcheck( 10.41329135, <=, 10.41329134 );
250 compcheck( 10.41329134, <=, 10.41329135 );
251 compcheck( 10.41329135, <=, 10.41329135 );
252 compcheck( -123.3, <=, 123.2 );
253 compcheck( -123.3, <=, -123.2 );
254 compcheck( -123.3, <=, -123.3 );
255 compcheck( -123.3, <=, -123.2 );
256 compcheck( 123.3, <=, -123.2 );
197} 257}
198 258
199int getHob( int x ) 259int getHob( int x )