#include <iostream>
#include <cmath>
using namespace std;

template <typename T> double sgn(T val) {
    return double((T(0) < val) - (val < T(0)))/(val == val);
}

int main() {
  cout << "sgn(-1)       : " << sgn(-1) << endl;
  cout << "sgn(0)        : " << sgn(0) << endl;
  cout << "sgn(1)        : " << sgn(1) << endl;
  cout << "sgn(-INFINITY): " << sgn(-INFINITY) << endl;
  cout << "sgn(-1.0)     : " << sgn(-1.0) << endl;
  cout << "sgn(-0.0)     : " << sgn(-0.0) << endl;
  cout << "sgn(0.0)      : " << sgn(+0.0) << endl;
  cout << "sgn(+1)       : " << sgn(+1.0) << endl;
  cout << "sgn(INFINITY) : " << sgn(+INFINITY) << endl;
  cout << "sgn(NAN)      : " << sgn(NAN) << endl;
  cout << "sgn(-NAN)     : " << sgn(-NAN) << endl;
	return 0;
}