diff options
author | Patrick Simianer <p@simianer.de> | 2014-06-14 16:46:27 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-06-14 16:46:27 +0200 |
commit | 26c490f404731d053a6205719b6246502c07b449 (patch) | |
tree | 3aa721098f1251dfbf2249ecd2736434c13b1d48 /ccc/float_int.cc |
init
Diffstat (limited to 'ccc/float_int.cc')
-rw-r--r-- | ccc/float_int.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ccc/float_int.cc b/ccc/float_int.cc new file mode 100644 index 0000000..9d0ece4 --- /dev/null +++ b/ccc/float_int.cc @@ -0,0 +1,26 @@ +#include <iostream> + +using namespace std; + + +int main(void) +{ + int a = 1; + int b = 2; + double q = (double)a/b; + cout << q << endl; + + cout << 1 - (float)a/b << endl; + + float x = 0.1; + unsigned y = 105; + unsigned z = x*y; + cout << z << endl; + + float u = -1; + if (u) cout << "XXXXXX" << endl; + + float j = 0.0; + if (j) cout << "j" << endl; +} + |