From 26c490f404731d053a6205719b6246502c07b449 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 14 Jun 2014 16:46:27 +0200 Subject: init --- ccc/float_int.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ccc/float_int.cc (limited to 'ccc/float_int.cc') 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 + +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; +} + -- cgit v1.2.3