From 258e1b92ebbfdebefabc120969ab87c3d8b75c3d Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 15 Jun 2014 03:50:12 +0200 Subject: old c,cc examples --- c,cc/float_int.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 c,cc/float_int.cc (limited to 'c,cc/float_int.cc') diff --git a/c,cc/float_int.cc b/c,cc/float_int.cc new file mode 100644 index 0000000..9d0ece4 --- /dev/null +++ b/c,cc/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