summaryrefslogtreecommitdiff
path: root/src/unitnumber.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/unitnumber.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unitnumber.cpp b/src/unitnumber.cpp
index 92cf1b7..fc56bf6 100644
--- a/src/unitnumber.cpp
+++ b/src/unitnumber.cpp
@@ -252,6 +252,8 @@ void UnitNumber::radix1()
252 252
253#define mathTestS( sc, anum, op, bnum, answ ) \ 253#define mathTestS( sc, anum, op, bnum, answ ) \
254 unitTest( (Number(anum, sc) op Number(bnum, sc)).toString() == answ ) 254 unitTest( (Number(anum, sc) op Number(bnum, sc)).toString() == answ )
255#define mathTestP( sc, anum, op, bnum, answ ) \
256 Bu::println(">>%1<<").arg((Number(anum, sc) op Number(bnum, sc)).toString())
255 257
256void UnitNumber::fraction1() 258void UnitNumber::fraction1()
257{ 259{
@@ -261,7 +263,9 @@ void UnitNumber::fraction1()
261 mathTestS( 8, "123.456", -, "0.987", "122.469" ); 263 mathTestS( 8, "123.456", -, "0.987", "122.469" );
262 mathTestS( 8, "123.456", *, "0.987", "121.851072" ); 264 mathTestS( 8, "123.456", *, "0.987", "121.851072" );
263 mathTestS( 8, "123.456", /, "0.987", "125.08206686" ); 265 mathTestS( 8, "123.456", /, "0.987", "125.08206686" );
264 266
267 mathTestP( 5, "63.6", /, "504", "0.12619" );
268 mathTestS( 5, "63.6", /, "504", "0.12619" );
265 mathTestS( 8, "12", /, "4", "3" ); 269 mathTestS( 8, "12", /, "4", "3" );
266 mathTestS( 100, "9", /, "1.9", "4.7368421052631578947368421052631578947368421052631578947368421052631578947368421052631578947368421052" ); 270 mathTestS( 100, "9", /, "1.9", "4.7368421052631578947368421052631578947368421052631578947368421052631578947368421052631578947368421052" );
267} 271}