summaryrefslogtreecommitdiff
path: root/c,cc/float_int.cc
blob: 9d0ece4ea568ca7638c3c58d45af6efd90b68d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
}