diff options
author | Mike Buland <mike@xagasoft.com> | 2013-04-19 15:36:29 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-04-19 15:36:29 -0600 |
commit | 7260c36973fc0ad7ff24294ff5540d64bf32c334 (patch) | |
tree | 72e74744a789d4c1acedfa1afd1a07219cce9931 /src/main.cpp | |
parent | 9ad1a65f4dcbc31b031556803d27dc688a16ff4a (diff) | |
download | clic-7260c36973fc0ad7ff24294ff5540d64bf32c334.tar.gz clic-7260c36973fc0ad7ff24294ff5540d64bf32c334.tar.bz2 clic-7260c36973fc0ad7ff24294ff5540d64bf32c334.tar.xz clic-7260c36973fc0ad7ff24294ff5540d64bf32c334.zip |
Fractional divisoin works.
It doesn't round yet, and there's a chance I should be increasing the
precision, right now it keeps the precision of the left hand side
number.
Diffstat (limited to '')
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index fe9a1fe..a9b0072 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
@@ -281,12 +281,15 @@ void fractest() | |||
281 | Number a( 8 ), b( 8 ); | 281 | Number a( 8 ), b( 8 ); |
282 | 282 | ||
283 | a = "123.456"; | 283 | a = "123.456"; |
284 | println("%1").arg( a ); | ||
285 | b = "0.987"; | 284 | b = "0.987"; |
286 | println("%1 + %2 = %3").arg( a ).arg( b ).arg( a + b ); | 285 | println("%1 + %2 = %3").arg( a ).arg( b ).arg( a + b ); |
287 | println("%1 - %2 = %3").arg( a ).arg( b ).arg( a - b ); | 286 | println("%1 - %2 = %3").arg( a ).arg( b ).arg( a - b ); |
288 | println("%1 * %2 = %3").arg( a ).arg( b ).arg( a * b ); | 287 | println("%1 * %2 = %3").arg( a ).arg( b ).arg( a * b ); |
289 | println("%1 / %2 = %3").arg( a ).arg( b ).arg( a / b ); | 288 | println("%1 / %2 = %3").arg( a ).arg( b ).arg( a / b ); |
289 | |||
290 | a = "12"; | ||
291 | b = "4"; | ||
292 | println("%1 / %2 = %3").arg( a ).arg( b ).arg( a / b ); | ||
290 | } | 293 | } |
291 | 294 | ||
292 | int main( int , char *[] ) | 295 | int main( int , char *[] ) |